Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.98k stars 11.35k forks source link

Error in `brew install mp4box` (gpac.rb) on Snow Leopard Server #2636

Closed moshen closed 13 years ago

moshen commented 14 years ago
cc -dynamiclib -Wl --warn-common -read_only_relocs warning -o ../../bin/gcc/gm_ogg_xiph.dylib ogg_in.o ogg_load.o vorbis_dec.o theora_dec.o  -L../../bin/gcc -lgpac -logg -lvorbis -ltheora
ld: warning: -read_only_relocs cannot be used with x86_64
cc -O3  -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common -fno-strict-aliasing -Wno-pointer-sign -I/private/tmp/homebrew-gpac-0.4.5-vb7m/gpac/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DGPAC_HAS_X11 -I/usr/X11R6/include -c -o sdl_out.o sdl_out.c 
cc -O3  -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common -fno-strict-aliasing -Wno-pointer-sign -I/private/tmp/homebrew-gpac-0.4.5-vb7m/gpac/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DGPAC_HAS_X11 -I/usr/X11R6/include -c -o audio.o audio.c 
cc -O3  -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common -fno-strict-aliasing -Wno-pointer-sign -I/private/tmp/homebrew-gpac-0.4.5-vb7m/gpac/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DGPAC_HAS_X11 -I/usr/X11R6/include -c -o video.o video.c 
cc -dynamiclib -Wl --warn-common -read_only_relocs warning -o ../../bin/gcc/gm_sdl_out.dylib sdl_out.o audio.o video.o -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lX11 -L/usr/X11R6/lib64 -L../../bin/gcc -lgpac
ld: warning: directory '/usr/X11R6/lib64' following -L not found
ld: library not found for -lX11
collect2: ld returned 1 exit status
make[2]: *** [gm_sdl_out.dylib] Error 1
make[1]: *** [plugs] Error 2
make: *** [mods] Error 2
Exit status: 2

http://github.com/mxcl/homebrew/blob/master/Library/Formula/gpac.rb#L26

==> Environment
HOMEBREW_VERSION: 0.7
HEAD: 
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit nehalem
OS X: 10.6.4
Kernel Architecture: x86_64
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
GCC-4.0: build 5494 
GCC-4.2: build 5664 
LLVM: build 2326 
MacPorts or Fink? false
X11 installed? true

==> Build Flags
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -msse4 -w -pipe
CXXFLAGS: -O3 -march=core2 -msse4 -w -pipe
Error: Failure while executing: make 
Please report this bug at http://github.com/mxcl/homebrew/issues

Also try:
  `brew doctor` to check your setup for common problems.
  `brew missing` to check installed packages for missing deps.

Probably not the best way to go about it, but adding the --cpu flag avoids the issue of the missing native X11 x64 libs.

Library/Formula/gpac.rb:

@@ -20,7 +20,7 @@ class Gpac <Formula
20  20     def install
21  21       ENV.deparallelize
22  22       system "chmod +x configure"
23      -    system "./configure", "--disable-wx", "--use-ffmpeg=no",
    23  +    system "./configure", "--disable-wx", "--use-ffmpeg=no", "--cpu=x86",
24  24                             "--prefix=#{prefix}",
25  25                             "--mandir=#{man}"
26  26       system "make"
adamv commented 14 years ago

I wonder if many Homebrew users are running in 64-bit kernel mode.

moshen commented 14 years ago

Probably not many. I didn't see anything in the issues list, so I thought I would add it.

Sharpie commented 14 years ago

I run an x86_64 kernel. Mostly because I grew tired of configure scripts getting profoundly confused when uname -a returns i386 but gcc outputs x86_64 by default.

akolov commented 13 years ago

I was able to fix that with "--extra-ldflags=-L/usr/X11R6/lib"

adamv commented 13 years ago

Fixed in 4a5c061aa296c995c0eac1ded9f3f0e2d1660a3d