giflib: fix "ld: library not found for -lSM" #42050
Conversation
I got this without ``depends_on :x11`` on os x 10.6.8 : ``` ==> Downloading https://downloads.sourceforge.net/project/giflib/giflib-4.x/giflib-4.2.3.tar.bz2 Already downloaded: /Library/Caches/Homebrew/giflib-4.2.3.tar.bz2 ==> ./configure --prefix=/usr/local/Cellar/giflib/4.2.3 ==> make install libtool: link: gcc-4.2 -dynamiclib -o .libs/libgif.4.dylib .libs/dgif_lib.o .libs/egif_lib.o .libs/gif_font.o .libs/gif_hash.o .libs/gifalloc.o .libs/gif_err.o -L/usr/X11/lib -lSM -lICE -lX11 -O2 -install_name /usr/local/Cellar/giflib/4.2.3/lib/libgif.4.dylib -compatibility_version 6 -current_version 6.7 -Wl,-single_module ld: library not found for -lSM collect2: ld returned 1 exit status make[1]: *** [libgif.la] Error 1 make: *** [install-recursive] Error 1 ```
We no longer allow formulae with hard X11 dependencies in the core repository. Can the X11 dependency be made optional? What options are you building giflib with? |
got error with $ brew install giflib
Warning: Formula file is modified!
Building from source because Library/Formula/giflib.rb has local changes
To install from a bottle instead, run with --force-bottle
==> Downloading https://downloads.sourceforge.net/project/giflib/giflib-4.x/giflib-4.2.3.tar.bz2
Already downloaded: /Library/Caches/Homebrew/giflib-4.2.3.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/giflib/4.2.3
==> make install
libtool: link: gcc-4.2 -dynamiclib -o .libs/libgif.4.dylib .libs/dgif_lib.o .libs/egif_lib.o .libs/gif_font.o .libs/gif_hash.o .libs/gifalloc.o .libs/gif_err.o -L/usr/X11/lib -lSM -lICE -lX11 -O2 -install_name /usr/local/Cellar/giflib/4.2.3/lib/libgif.4.dylib -compatibility_version 6 -current_version 6.7 -Wl,-single_module
ld: library not found for -lSM
collect2: ld returned 1 exit status
make[1]: *** [libgif.la] Error 1
make: *** [install-recursive] Error 1 here is modified formula require 'formula'
class Giflib < Formula
desc "GIF library using patented LZW algorithm"
homepage 'http://giflib.sourceforge.net/'
# 4.2.0 has breaking API changes; don't update until
# things in $(brew uses giflib) are compatible
url 'https://downloads.sourceforge.net/project/giflib/giflib-4.x/giflib-4.2.3.tar.bz2'
sha256 '0ac8d56726f77c8bc9648c93bbb4d6185d32b15ba7bdb702415990f96f3cb766'
bottle do
cellar :any
sha256 "d51319dcc61c11386ffb963a7d0b3c9c7d4e5d62beb6b863aba9691f56df9132" => :yosemite
sha256 "bc2e9f9f053b82868f5e3a83be6c8f700141580f3f8b47fa58459721846a6cb2" => :mavericks
sha256 "d38a310aa80f627a23b65b71e97baf6d08d8daa8281595f523e8116f5d4eace1" => :mountain_lion
end
depends_on :x11 => :optional
option :universal
def install
ENV.universal_binary if build.universal?
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "make install"
end
end Note: works with |
Thanks! Could you also post |
I ran into this issue too:
gits file is here: https://gist.github.com/76f72b501f5139e6ac48 |
Wondering if this is a compiler problem rather than a formula problem, to be honest. Any thoughts @mistydemeo? |
10.7.5 here. Same problem, any progress? |
Having the same problem in 10.7.5. I've tried changing the compiler by setting the |
Moved to MacPorts already. The problem is gone. In addition, MacPorts allows installing TexLive. |
This problem should be resolved by #42921. Feel free to test it locally. |
I got this on os x 10.6.8 :