134 Commits

Author SHA1 Message Date
Adam Vandenberg
2a40ff08a2 Only add -F if the frameworks folder exists
Closes Homebrew/homebrew#16901.
2013-01-04 21:30:10 -08:00
Jack Nagel
9c8a73cf41 Allow requirements to specify env options 2012-12-26 14:37:03 -06: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
Charlie Sharpsteen
14cb8c8fce ENV.rb: Configure Objective-C++ compiler
Ensures the `OBJCXX` environment variable is correctly set. Also adds `OBJC`
and `OBJCXX` to `ENV.remove_cc_etc`.
2012-11-13 20:54:33 -08:00
Adam Vandenberg
ff55e7d82e Move vendored .pc files to ENV
Closes Homebrew/homebrew#15961.
2012-11-11 09:55:12 -08:00
Jack Nagel
5de12d7182 Inject framework paths into stdenv compiler flags 2012-11-06 12:32:10 -06:00
Max Howell
f3b7b933fa Fix ENV.fortran info texts
They were being truncated.
2012-09-28 17:14:56 -04:00
Misty De Meo
3633995fc9 stdenv: stop setting LD
superenv stopped setting LD in
8e4c0a141171666270529da4be026d529d474467, seems sensible to follow
suit in stdenv too.

See Homebrew/homebrew#14943.

Fixes Homebrew/homebrew#15090.
2012-09-26 13:22:30 -05:00
Max Howell
b94e220bc3 ENV.fortran adds back superenv removed PATHs
Fixes Homebrew/homebrew#15103.
2012-09-25 12:04:42 -04:00
Jack Nagel
55a95ee0ab ENV: put X11 aclocal dir in ACLOCAL_PATH when appropriate
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-05 19:49:50 -05:00
Jack Nagel
2d1a941976 Sort out remaining XQuartz/stdenv issues
We use PKG_CONFIG_LIBDIR to reset the default search path, overriding
whatever is baked into the pkg-config executable. This way, we can later
append XQuartz paths here while still allowing any brewed libs to take
precedence, keg-only or not.

Hopefully this will resolve any remaining issues, and let us get rid of
some per-formula hacks.

c.f. Homebrew/homebrew#14474.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 22:39:38 -05:00
Jack Nagel
8094b00b55 ENV: update comment
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 22:38:05 -05:00
Jack Nagel
33233f5039 Stop warning in ENV.x11
It has been long enough since `depends_on :x11` was introduced that we
can make it the caller's responsibility to ensure X11 is present before
invoking ENV.x11, so stop outputting a warning.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-03 21:04:49 -05:00
Max Howell
95164a5d46 Use fortran from std-env in superenv
Fixes Homebrew/homebrew#14524.
2012-08-29 14:45:04 -04:00
Max Howell
65d195dcaa superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.

Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.

The previous ENV-system is still available when --env=std is specified.

superenv applies to Xcode >= 4.3 only currently.
2012-08-29 12:41:34 -04:00
Mike McQuaid
90010f4602 Fix tests and NoMethodError with no X11 installed. 2012-08-25 10:21:48 -07:00
Jack Nagel
a4fbae274f Compact whitespace when removing flags
This prevents multiple calls to flag-modifying ENV methods from
resulting in large amounts of consecutive spaces.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 22:29:56 -05:00
samueljohn
ad0dd3d3de Xcode-only: Clean up compiler flags. Use CPATH.
- When using CPATH, we only need -isysroot and not the other -I spam.
- LDFLAGS use -isysroot instead of -L
  Turns out that the linker also understands the
  -isysroot flag which behaves more natural (in the
  sense: "like the internal defaults `/usr/lib` etc.)
  than adding `-L$(SDKROOT).
  Especially for duplicates, the linker first searches
  through all `-L` dirs and then looks at the sysroot
  or internal defaults. This is what we want.
- Pkg-config needs CC with CFLAGS passed to configure.

Closes Homebrew/homebrew#14351.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 16:26:28 -05:00
Jack Nagel
166a9ba0ed Deprecate MacOS.version? style methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:25:59 -05:00
Jack Nagel
7488b9844b Adjust XQuartz/X11 module naming scheme
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-06 00:39:06 -05:00
Mike McQuaid
385e5dacd2 Use LC_CTYPE rather than LANG for most specific ML sed fix.
Fix Homebrew/homebrew#11728, fix Homebrew/homebrew#12890, fix Homebrew/homebrew#13653, fix Homebrew/homebrew#13734, fix Homebrew/homebrew#13787, fix Homebrew/homebrew#13818,
fix Homebrew/homebrew#13939.
2012-08-04 10:48:23 +01:00
Mike McQuaid
c632d733bc Fix Mountain Lion sed by setting LANG.
It's also necessary to delete LC_ALL or it overrides the new LANG.
LC_COLLATE is the problem variable but is affected by LANG and LC_ALL
so just use them instead. Extends the fix made to geoip in dc955c.

Fix Homebrew/homebrew#11728, fix Homebrew/homebrew#12890, fix Homebrew/homebrew#13653, fix Homebrew/homebrew#13734, fix Homebrew/homebrew#13787, fix Homebrew/homebrew#13818.
2012-08-02 20:26:01 +01:00
Jack Nagel
148617bc11 Move X11 machinery into MacOS::XQuartz namespace
In order to better support Xcode-only systems, where X11 libs and
executables live under /usr/X11 but headers live in the SDK, move the
x11_* helper methods into a new module.

This allows us to keep some of the CLT/Xcode-only and Apple X11/XQuartz
logic hidden from outside code, like ENV.x11.

Since Apple's X11 is actually XQuartz, name the module "MacOS::XQuartz".
2012-08-01 00:31:38 -05:00
Misty De Meo
6a8c4843f7 Provide missing .pc files for 10.8
10.8 no longer ships four .pc files which were included in previous
versions, though it does still include the libraries which they pointed
to. This commit provides copies of the .pc files for all of these, and
prepends Library/Homebrew/pkgconfig to PKG_CONFIG_PATH on 10.8.

The .pc files in question are: lib curl, lubexslt, libxml-2.0, libxslt

Fixes Homebrew/homebrew#13673.
Fixes Homebrew/homebrew#13627.
Fixes Homebrew/homebrew#13652.
Fixes Homebrew/homebrew#13482.
Closes Homebrew/homebrew#13572.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-07-29 10:28:41 -03:00
Jack Nagel
4eeb0e6441 Use new Xcode module
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 12:04:41 -05:00
Jack Nagel
62482504a9 Split Xcode and CLT methods into separate modules
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-25 11:58:01 -05:00
samueljohn
dd9ef7b71b ENV: remove -L from CFLAGS.
SDK/usr/include and lib now appended instead of prepended.
Prepending overwrote our precedence of HOMEBREW_PREFIX/include and lib.

Closes Homebrew/homebrew#13292.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-07-09 09:36:25 -07:00
Camillo Lugaresi
a07085df2d use XQuartz when present 2012-07-01 12:10:32 -05:00
samueljohn
13e14ef65a Fix Homebrew/homebrew#13012 properly and don't set the SDK if CLT
Undoing parts of the hot fix 78b9e8548e771a59e382e6f13339664ec5498391.

The only thing missing was to check for `system "/usr/bin/xcrun -find make 1>/dev/null 2>&1"`
and then it's safe to call locate.

This commit restores the original functionality but without the risk for recursion
and improves the logic of `MacOS.locate`. See below.

To important changes in this commit:

- For Xcode _and_ CLT: don't add the SDK and leave things as before.
So if `MacOS.clt_installed?`, then no `SDKROOT` and `-L` and `-I`
directories are set in `ENV.macosxsdk`.

- Improved the logic for `MacOS.locate` for Xcode-only situations
by assuring that the xcode-select path is correct. This is done
by checking that `bin/make` exists and is executable. Otherwise it
was possible to set xcode-select to an empty dir.
This check is done in `MacOS.sdk_path` too.
We are now able to use Xcode wherever it is and can work even, if
xcode-select is set to invalid values. (Remember some users don't
have sudo access and that is needed to fix xcode-select).

Some minor whitespace fixes.
Minor backtick fix in doctor.rb's printout.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-27 11:50:43 -07:00
samueljohn
725feb3db1 Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!

Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)

Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.

Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.

Closes Homebrew/homebrew#10510.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-24 19:11:06 -07:00
Charlie Sharpsteen
c9652760ed ENV.rb: Always return integers from make_jobs
When referencing `Hardware.processor_count`, `ENV.make_jobs` will return an
integer. If referencing the environment variable `HOMEBREW_MAKE_JOBS`, it
returned a string.

Now, the function always returns an integer.

Fixes Homebrew/homebrew#12033.
2012-05-03 15:49:27 -07:00
Charlie Sharpsteen
5582ca2548 Revert "ENV.rb: Always return integers from make_jobs"
This reverts commit ea1a9e603abe3dab90bf5b157d2614cf58e2cc8e.

Argh. Unrelated PySide changes slipped in.
2012-05-03 15:48:51 -07:00
Charlie Sharpsteen
52834b8617 ENV.rb: Always return integers from make_jobs
When referencing `Hardware.processor_count`, `ENV.make_jobs` will return an
integer. If referencing the environment variable `HOMEBREW_MAKE_JOBS`, it
returned a string.

Now, the function always returns an integer.

Fixes Homebrew/homebrew#12033.
2012-05-03 15:45:31 -07:00
Jack Nagel
5dc15272d9 ENV: reset LD when switching compilers
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-21 12:22:22 -05:00
Jack Nagel
01c14f8775 ENV: normalize usage of "self" and "ENV"
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-21 12:22:22 -05:00
Jack Nagel
fe58c056d3 Explicitly set OBJC in the environment
Fixes Homebrew/homebrew#10951.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 16:36:17 -05:00
Mike McQuaid
b86ead91ea Revert "Always build bottles universally."
This reverts commit 72a477f2734939d4c5805247588c4cdea69b5383.
2012-03-10 19:28:46 +13:00
Mike McQuaid
6d940a5bcc Always build bottles universally. 2012-03-10 18:11:12 +13:00
Charlie Sharpsteen
275d22db9e ENV.rb: Set GCC-style CPU flags for GFortran
GFortran chokes when it is passed CPU flags specific to Clang. This change
ensures the environment variables `FCFLAGS` and `FFLAGS` contain the same CPU
flags that would be set for the GCC compiler.

Fixes Homebrew/homebrew#10424.
Fixes Homebrew/homebrew#10744.

Closes Homebrew/homebrew#10774.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:08 -08:00
Charlie Sharpsteen
55d4f48746 ENV.rb: Generalize method for setting CPU flags
All logic has been copied into a new method `set_cpu_flags` that accepts an
additional argument, `flags`, which contains a list of environment variables
for which the CPU flags are to be adjusted.

`set_cpu_cflags` now recalls `set_cpu_flags` and passes `cflags_flags` as the
first argument.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:05 -08:00
Charlie Sharpsteen
1805e87529 ENV.rb: Modifier methods accept lists of flags
`ENV` methods that modify environment variables, `prepend`, `append` and
`remove`, can now accept lists of flags as well as a single flag.

The list of flags affected by `append_to_cflags` and `remove_from_cflags` are
now definied in a shortcut method `cc_flag_vars`.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2012-03-09 12:14:04 -08:00
Max Howell
f3d177a99b Set ACLOCAL_PATH so that things work
This should mean all those formula that pass options to aclocal don't need to anymore, but I'm not risking changing them.
2012-02-27 04:06:39 +00:00
Jack Nagel
5d58792c5e Fix IO redirection in ENV.xcrun
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-26 15:01:01 -06:00
Charlie Sharpsteen
c0299ad19b ENV.rb: Set flags for Objective-C
We set defaults for C and C++, might as well do the same for Objective-C and
Objective-C++.

Closes Homebrew/homebrew#10354.
2012-02-21 21:34:48 -08:00
Max Howell
61a8bd9ca0 Don't hang if xcode-select -print-path is "/"
Introducing MacOS.xctools_fucked?.

Refs Homebrew/homebrew#10293.
2012-02-21 10:33:03 +00:00
Jack Nagel
a7ade739dc Remove -Qunused-arguments in ENV.enable_warnings
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:41:47 -06:00
Jack Nagel
f295661ca6 Remove unused :force switches
The :force behavior for ENV.gcc has been the default for some time, and
was used to force vanilla gcc in case the gcc symlink pointed at
llvm-gcc; for ENV.clang, this doesn't mattera as clang is just clang.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:22:27 -06:00
Jack Nagel
f8e3e806f9 Silence unused argument warnings from clang
The clang frontend ignores a number of options that are accepted by gcc
and llvm-gcc. However, it produces a warning for each unused argument at
each invocation, which can result in many lines of noise, e.g.

   clang: warning: argument unused during compilation: '-rdynamic'

Since these arguments do not affect compilation, let's just silence the
warnings by passing '-Qunused-arguments' to clang by default.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:22:17 -06:00
Jack Nagel
78d4fda6d6 ENV: clean up set_cpu_cflags a bit
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-21 00:20:29 -06:00