Homebrew/homebrew — pull request #26111 by tesseract2048 (2014-01-23 01:04:36+00:00)
Title: fix guile linking issue

I have encountered problem when installing guile, and got this with interactive:

CCLD libguile-2.0.la
Undefined symbols for architecture x86_64:
"___gmpz_clears", referenced from:
_scm_i_divide2double in libguile_2.0_la-numbers.o
_idbl2str in libguile_2.0_la-numbers.o
_scm_exact_integer_sqrt in libguile_2.0_la-numbers.o
"___gmpz_inits", referenced from:
_scm_i_divide2double in libguile_2.0_la-numbers.o
_idbl2str in libguile_2.0_la-numbers.o
_scm_exact_integer_sqrt in libguile_2.0_la-numbers.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libguile-2.0.la] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

i suppose this is about libgmp was not found while linking.

so i append this line to configure part of the formula and it worked as expected:

"--with-libgmp-prefix=#{Formula.factory('gmp').prefix}"

the following information would help to reproduce the issue:
## environment

### osx version
10.9.1

### kernel
Darwin hostname.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

### installed formulas

autoconf	bison	gettext	isl
libffi	libsvm	libunistring	openssl
tesseract	automake	cloog	gfortran
jpeg	libmpc	libtiff	mit-scheme
pkg-config	wget	bdw-gc	flex
gmp	leptonica	libpng	libtool
mpfr	readline

### variables (inside interactive mode)

export ACLOCAL_PATH="/homebrew-master/share/aclocal"
export CC="clang"
export CMAKE_INCLUDE_PATH="/usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers"
export CMAKE_LIBRARY_PATH="/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries"
export CMAKE_PREFIX_PATH="/homebrew-master/opt/libffi:/homebrew-master/opt/readline:/homebrew-master"
export CXX="clang++"
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
export DISPLAY="/tmp/launch-iQ9GkU/org.macosforge.xquartz:0"
export HOME="/var/root"
export HOMEBREW_BREW_FILE="/homebrew-master/bin/brew"
export HOMEBREW_CC="clang"
export HOMEBREW_CCCFG="sa"
export HOMEBREW_CXX="clang++"
export HOMEBREW_DEBUG_INSTALL="guile"
export HOMEBREW_DEBUG_PREFIX="/homebrew-master/Cellar/guile/2.0.9"
export HOMEBREW_DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
export HOMEBREW_ERROR_PIPE="5"
export HOMEBREW_OPTFLAGS="-march=native"
export HOMEBREW_OPTIMIZATION_LEVEL="Os"
export HOMEBREW_PREFIX="/homebrew-master"
export HOMEBREW_TEMP="/tmp"
export LANG="en_US.UTF-8"
export LOGNAME="root"
export MAIL="/var/mail/root"
export MAKEFLAGS="-j4"
export OBJC="clang"
export OBJCXX="clang++"
export OLDPWD
export PATH="/homebrew-master/Library/ENV/4.3:/homebrew-master/opt/pkg-config/bin:/homebrew-master/opt/libtool/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig:/homebrew-master/Library/ENV/pkgconfig/10.9"
export PKG_CONFIG_PATH="/homebrew-master/opt/libffi/lib/pkgconfig:/homebrew-master/opt/bdw-gc/lib/pkgconfig"
export PWD="/private/tmp/guile-JBuh/guile-2.0.9"
export SHELL="/bin/sh"
export SHLVL="2"
export SSH_AUTH_SOCK="/tmp/launch-LJDfI7/Listeners"
export SUDO_COMMAND="/bin/sh"
export SUDO_GID="20"
export SUDO_UID="501"
export SUDO_USER="hidden"
export TERM="xterm-256color"
export USER="root"
export USERNAME="root"
export __CF_USER_TEXT_ENCODING="0x1F5:0:0"