Skip to content
This repository
Browse code

botan: fix xcode-only install

- botan's configure.py ignores our CFLAGS and switches the compiler to
  llvm :-/ We can use the MACH_OPT variable to insert our CLFAGS and
  make this build with Xcode-only setups.
- Using ENV.compiler.to_s for the compiler string.
- Fixing the "ld: unknown option soname" issue when using clang.

Closes #13065.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
commit 89b60370ef7eccfebf78efc7e5754be603dc10ff 1 parent 42c62f7
Samuel John authored jacknagel committed

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  Library/Formula/botan.rb
8  Library/Formula/botan.rb
@@ -13,8 +13,14 @@ def install
13 13
     args = ["--prefix=#{prefix}"]
14 14
     args << "--cpu=x86_64" if MacOS.prefer_64_bit?
15 15
     args << "--enable-debug" if ARGV.include? "--enable-debug"
  16
+    # The --cc option needs "clang" or "gcc" and not the full path.
  17
+    args << "--cc=#{ENV.compiler.to_s}"
16 18
 
17 19
     system "./configure.py", *args
18  
-    system "make install"
  20
+    # "-soname" can lead to issues like https://github.com/mxcl/homebrew/issues/11972
  21
+    inreplace "Makefile", "-Wl,-soname", "-dynamiclib -install_name "
  22
+    # A hack to force them use our CFLAGS. MACH_OPT is empty in the Makefile
  23
+    # but used for each call to cc/ld.
  24
+    system "make", "install", "MACH_OPT=#{ENV.cflags}"
19 25
   end
20 26
 end

0 notes on commit 89b6037

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