Skip to content
Browse files

freeimage: add universal option

 - Fix discarded LDFLAGS so linking works as expected (required for
   universal build).

Closes #11178.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
1 parent 6c496b7 commit 5bf140090054d5b36888f6cc9156c09baf700782 @binarycrusader binarycrusader committed with jacknagel Mar 24, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 Library/Formula/freeimage.rb
View
9 Library/Formula/freeimage.rb
@@ -15,11 +15,16 @@ class Freeimage < Formula
md5 '450d2ff278690b0d1d7d7d58fad083cc'
homepage 'http://sf.net/projects/freeimage'
+ def options
+ [[ '--universal', 'Build a universal binary' ]]
+ end
+
def patches
DATA
end
def install
+ ENV.universal_binary if ARGV.build_universal?
system "gnumake -f Makefile.gnu"
system "gnumake -f Makefile.gnu install PREFIX=#{prefix}"
system "gnumake -f Makefile.fip"
@@ -71,7 +76,7 @@ def install
$(SHAREDLIB): $(MODULES)
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-+ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) -o $@ $(MODULES)
++ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES)
install:
install -d $(INCDIR) $(INSTALLDIR)
@@ -125,7 +130,7 @@ def install
$(SHAREDLIB): $(MODULES)
- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
-+ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) -o $@ $(MODULES)
++ $(CXX) -dynamiclib -install_name $(LIBNAME) -current_version $(VER_MAJOR).$(VER_MINOR) -compatibility_version $(VER_MAJOR) $(LDFLAGS) -o $@ $(MODULES)
install:
install -d $(INCDIR) $(INSTALLDIR)

0 comments on commit 5bf1400

Please sign in to comment.
Something went wrong with that request. Please try again.