This repository has been archived by the owner. It is now read-only.
Browse files

botan: fix xcode-only install

- botan's 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 <>
  • Loading branch information...
samueljohn authored and jacknagel committed Jun 25, 2012
1 parent 42c62f7 commit 89b60370ef7eccfebf78efc7e5754be603dc10ff
Showing with 7 additions and 1 deletion.
  1. +7 −1 Library/Formula/botan.rb
@@ -13,8 +13,14 @@ def install
args = ["--prefix=#{prefix}"]
args << "--cpu=x86_64" if MacOS.prefer_64_bit?
args << "--enable-debug" if ARGV.include? "--enable-debug"
+ # The --cc option needs "clang" or "gcc" and not the full path.
+ args << "--cc=#{ENV.compiler.to_s}"
system "./", *args
- system "make install"
+ # "-soname" can lead to issues like
+ inreplace "Makefile", "-Wl,-soname", "-dynamiclib -install_name "
+ # A hack to force them use our CFLAGS. MACH_OPT is empty in the Makefile
+ # but used for each call to cc/ld.
+ system "make", "install", "MACH_OPT=#{ENV.cflags}"

0 comments on commit 89b6037

Please sign in to comment.