172 Commits

Author SHA1 Message Date
Jack Nagel
803a408b1d Differentiate between "cpp" and "cc-E" modes 2013-08-31 10:43:24 -05:00
Jack Nagel
773ed20476 Reorder cc wrapper modes by frequency 2013-08-31 10:38:34 -05:00
Jack Nagel
d61d054eac superenv: fix no-op system path filtering 2013-08-29 19:08:22 -05:00
Misty De Meo
c58d707158 Allow building bottles with custom architectures
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc.
2013-08-28 20:21:06 -07:00
Misty De Meo
8a99ea2094 superenv: also filter out -mcpu=
On PPC, -mcpu is the preferred equivalent to -march.
2013-08-28 20:01:58 -07:00
Misty De Meo
a39ba39688 Revert "superenv: fix cpp shim"
This reverts commit dca89db55189a34f1c02d3f12a84eda8d81fd6d1.
2013-08-27 18:31:57 -07:00
Misty De Meo
55654933f5 superenv: fix cpp shim
This sets cpp to use the compiler as cpp, and works with scripts which
pass values to cpp on stdin as well as with file arguments.

Closes Homebrew/homebrew#22155.
2013-08-27 18:24:08 -07:00
Misty De Meo
f0bf64e1e9 superenv: support PPC bottles
Allows for building bottles on PPC both with and without Altivec.
This is currently not active but will be enabled once superenv is
stable on Leopard.
2013-08-25 14:51:48 -07:00
Jack Nagel
84369dd949 Always pass -headerpad_max_install_names to the linker
We use install_name_tool pretty liberally, so we need to take steps to
ensure libraries and executables are always linked with this flag.

Closes Homebrew/homebrew#20233.
Fixes Homebrew/homebrew#17984.
Fixes Homebrew/homebrew#22078.
2013-08-23 11:36:03 -05:00
Jack Nagel
1bcd428b8e Fix superenv arch flag handling
Fixes Homebrew/homebrew#21943.
2013-08-16 20:46:03 -05:00
Misty De Meo
1586a69879 superenv: use Hardware::CPU.universal_archs
This defines the new HOMEBREW_ARCHS environment variable, which is
currently only set during universal builds, so that the tool wrappers
no longer need to hardcode i386/x86_64.
2013-08-15 22:46:57 -07:00
Misty De Meo
0845341de3 cc: delegate cpp to the real tool, not compiler
Fixes Homebrew/homebrew#21527.
2013-07-30 18:41:27 -07:00
Misty De Meo
988316a16d Enable superenv on Snow Leopard
This has been tested with several dozen formulae without any
superenv-related issues.
2013-07-19 14:13:11 -07:00
Misty De Meo
0430589fbc superenv cc: specify llvm-g++-4.2
We previously tried to call llvm-g++ under the name `g++`,
but this is now a link to clang on Xcode 5+.

Fixes Homebrew/homebrew#20691.
2013-06-27 14:56:47 -05:00
Misty De Meo
d23ce833d7 Add pkg-config files for 10.9
Seems to be that 10.9 needs the same ones as 10.8.

Fixes Homebrew/homebrew#20436.
2013-06-12 09:51:22 -05:00
Samuel John
0688991507 superenv: Work if build tool changes DEVELOPER_DIR
Some build systems still set the DEVELOPER_DIR to /Developer
and then nothing works any more (xcrun, xcodebuild etc.)
I am looking at you MacVim.
2013-06-03 17:29:43 +02:00
Misty De Meo
63b9031159 superenv: find Homebrew's gcc-4.2
If we're using a homebrewed gcc-4.2, xcrun may fail to find it (or,
worse, find superenv's shim instead). Explicitly add it to the PATH and
search all path elements for the requested tool.

Also make sure to specify 'gcc-4.2' as the compiler name, not plain
'gcc'. That can resolve to llvm-gcc and to gcc-4.0 on various Xcodes.
2013-06-02 14:44:27 -05:00
Misty De Meo
d212b360ec superenv: Improve compiler selection
This fixes superenv on Xcode 3.2.6, and also fixes C++ software with
gcc-4.2 on all Xcodes.
2013-05-27 12:56:25 -05:00
Mike McQuaid
ad5c1b81cd Fix --build-bottle CFLAGS.
The CFLAGS were previously not generic enough.

References Homebrew/homebrew#18944.
References Homebrew/homebrew#19179.
2013-05-11 12:18:25 +01:00
Max Howell
8bfc6e024d Add an alias to gmake in superenv
I had a luarock explicitly look ONLY for gmake, FFS.

This should be safe.
2013-04-09 13:58:32 -04:00
Samuel John
261ca7aa6a superenv: Filter out -isysroot
Closes Homebrew/homebrew#16576.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-03-29 11:10:18 -07:00
Samuel John
c6b0b563e8 Better superenv support for Xcode elsewhere
- The Library/ENV/4.3/xcrun shim now respects
  ENV['DEVELOPER_DIR'] instead assuming the location
  of /Applications/Xcode.app/Contents/Developer.
- The env var DEVELOPER_DIR is set if it is not
  already. So, during superenv this var is always set
  and we no longer have to care about people with unset
  or wrongly set xcode-select stuff. This has been
  a major PITA in the past.
- determine_developer_dir (which is used to set
  the DEVELOPER_DIR var) now uses MacOS::Xcode.prefix
  which is proven and very capable and uses splotlight
  correctly.
- Replace (and remove) MacSystem.xcode43_developer_dir
  with Xcode.prefix

Closes Homebrew/homebrew#18618
2013-03-21 17:10:32 +01:00
Jack Nagel
878747d458 Index pkgconfig directories by MacOS.version 2013-03-09 14:46:01 -06:00
Jack Nagel
21b583ba46 -std, not --std 2013-03-07 22:42:42 -06:00
Jack Nagel
df1d27b037 superenv/cc: keep exec monkeypatch out of Object 2013-03-06 17:06:07 -06:00
Jack Nagel
4adf0b0f69 superenv/cc: make file loadable 2013-03-06 17:06:07 -06:00
mbcoguno
97368f8dfc Contributions: fix soft link that not refer current file.
a6324cb forget fix soft link in ENV folder, it cause superenv
use Apple provided git and svn.

Closes Homebrew/homebrew#17927.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-02-18 18:29:03 +00:00
Adam Vandenberg
1283bd8381 xcrun: remove suggestion that doesn't work
Closes Homebrew/homebrew#17443.
2013-02-05 11:22:47 -08:00
Misty De Meo
2e23e9a22d superenv: --use-gcc should specify gcc-4.2
Since 'gcc' is a symlink to 'llvm-gcc' on Xcode 4.3+, --use-gcc and
--use-llvm were doing exactly the same thing. Combined with the
previous commit, this allows users with either a leftover
/usr/bin/gcc-4.2 or a homebrewed apple-gcc42 to build with gcc.

This doesn't however fix Xcode-only systems with apple-gcc42.

Fixes Homebrew/homebrew#17243.
2013-01-26 22:57:56 -06:00
Misty De Meo
88609dd6ed xcrun: actually try fallbacks
xcrun has a lot of fallbacks if the first case fails but never actually
reaches them on CLT systems since it doesn't check the validity of the
first path before executing it.

(When should it reach these? Mainly for non-Xcode compilers we
support, e.g. apple-gcc42 which can be found by xcrun but which isn't
in /usr/bin)

The xcrun invocation also needed chomping.
2013-01-26 22:53:29 -06:00
Samuel John
293be41d5c superenv: Allow ENV.m32 (for 32bit builds)
Superenv normally filters out "-m32" flag, preventing 32bit builds.
Some software, however, still only work in 32bit mode.

If ENV.m32 is called, superenv does not filter out the "-m32" flag.
Also note, superenv, does not explicitly add the -m32 flag and
expects the build system of the software to know when and where to
provide this flag.

Closes Homebrew/homebrew#16350.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-24 19:21:57 -08:00
Jack Nagel
8135ed6528 superenv: allow -W[alp], style arguments to pass through
We already (correctly) allow -Wl, style linker arguments to pass
through; extend this to -Wp, (preprocessor) and -Wa, (assembler).

Fixes Homebrew/homebrew#17252.
2013-01-23 00:18:01 -06:00
Adam Vandenberg
a5e969dfb5 superenv: make HOMEBREW_FILE available
Superenv scripts have a stripped PATH, which may not include
the brew binary itself. Make this explicitly available to
superenv scripts.

Fixes bsdmake wrapper.

Closes Homebrew/homebrew#16805.
Closes Homebrew/homebrew#16846.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-03 09:14:36 -08:00
Camillo Lugaresi
5e39ce44fe separate ENV/pkgconfig dirs by OS version
Closes Homebrew/homebrew#16063.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-11-19 22:04:04 -06:00
Camillo Lugaresi
cf7f0f250f add necessary .pc files for Leopard
add missing libcrypto.pc
override broken system libcurl.pc

Closes Homebrew/homebrew#16063.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-11-19 22:03:00 -06:00
Max Howell
2446e5ee8a dels -> dups typo
/cc @samueljohn
2012-11-13 11:18:19 -05:00
Adam Vandenberg
ff55e7d82e Move vendored .pc files to ENV
Closes Homebrew/homebrew#15961.
2012-11-11 09:55:12 -08:00
Max Howell
d458200223 superenv: Builds need to use the right git/svn too
stdenv already works as Contributions/cmds is in the path already.

This is safe to do because OS X already has git and svn in the PATH if you have the CLT installed. So we should definitely ensure we use the right versions.

Fixes Homebrew/homebrew#15783.
2012-11-02 09:34:25 -04:00
Xiyue Deng
6762780f3e Whitelist Homebrew's own prefix in superenv.
This allows Homebrew to be installed into /opt or /sw.

Closes Homebrew/homebrew#15780.

Signed-off-by: Max Howell <mxcl@me.com>

Cleaned up the patch a little. Still ugly though, but logic is unusual so that's just how it is.
2012-11-01 09:51:41 -04:00
Adam Vandenberg
e502728641 Superenv: be more specific about -O flags
Closes Homebrew/homebrew#15775.
2012-10-31 06:50:50 -07:00
Max Howell
a967f5c82a Use cc -E, not cpp -E. Fixes Homebrew/homebrew#15402. 2012-10-28 10:52:06 -04:00
Max Howell
64927a45ef Restore HOMEBREW_LOG functionality 2012-09-29 09:57:37 -04:00
Max Howell
d0f707f893 Determine SUPERBIN correctly 2012-09-25 11:31:56 -04:00
Max Howell
a217b03952 Clean up and improve build-error output and logs
All logs are now stored from each command executed in Formula.install.

Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
2012-09-25 11:31:56 -04:00
Max Howell
c076a272ee Work even when RUBYLIB='-'
Apparently setting RUBYLIB to '-' causes the library path to be unset. So we need to set our own library path in our scripts.

Fixes Homebrew/homebrew-versions/#47.
2012-09-24 09:49:54 -04:00
Max Howell
1ae0e93d7e Abort if xcrun -find foo returns superbin/foo
Fixes Homebrew/homebrew#14691.

Rewrite in Ruby to facilitate checking PATHs properly.
2012-09-24 09:49:53 -04:00
Max Howell
4bf72a3e62 Puts build-tool args first
build-tool provided args must be considered first by cc, etc. Generally this already occurred for -I flags, because most of our -I flags were -isystem. However it didn't occur for keg-only flags and -L paths.

This was an error.

I amended the refurbishment code to ensure any paths we want to control the order of are thoroughly scrubbed out of the build-tool provided args. This ensures reliability for our builds.

However this path-scrubbing should always occur, even during configure (I am fairly sure of this). So more work is required.

Fixes Homebrew/homebrew#14781.
2012-09-14 11:55:59 -04:00
Max Howell
da1905f216 Make xcrun wrapper search /usr/bin too
The usual xcrun would, and this wrapper exists to also work around broken xcode-select paths.
2012-09-13 17:00:02 -04:00
Max Howell
514b1b54cd Support c99/c89 compiles properly
We can't really execute c89/99 explicitly as these POSIX compliant tools support very few args. Best to execute clang or gcc with the --std=cx9 argument appended.

Fixes Homebrew/homebrew#14724.
2012-09-13 11:30:11 -04:00
Max Howell
ffc6423d73 Look harder for bsdmake
bsdmake used to be keg-only, so some users still have it unlinked (presumably they never run brew-doctor). Even though there is code to abort if dependencies are unlinked, it appears broken for this case. So let's just be thorough anyway.

Closes Homebrew/homebrew#14751.
2012-09-13 11:28:31 -04:00