Opened 14 years ago
Last modified 12 years ago
#28063 new defect
gnustep-base configure fails on 10.6, "I don't seem to be able to use your Objective-C compiler to produce working binaries"
Reported by: | ivan@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.9.2 |
Keywords: | Cc: | anddam (Andrea D'Amore), cooljeanius (Eric Gallager) | |
Port: | gnustep-base |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
Attempting to install "gnustep" results in a failure while configuring "gnustep-base" on 10.6.
configure fails on step "checking whether objc really works…".
I do not have GCC 4.2 installed from MacPorts; Apple's GCC 4.2 is installed, and used by GNUstep-base. Despite that, there are several references in the log to attempting to use MacPorts GCC 4.2: FFII library from /opt/local/include/gcc42 and /opt/local/lib/gcc42 is apparently used. See this line from the log:
:info:configure shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnustep_gnustep-base/work/gnustep-base-1.19.1" && ./configure --prefix=/opt/local CC=/usr/bin/gcc-4.2 GNUSTEP_MAKEFILES=/opt/local/GNUstep/System/Library/Makefiles --disable-tls --enable-libffi --with-ffi-include=/opt/local/include/gcc42 --with-ffi-library=/opt/local/lib/gcc42 " returned error 1
MP-GCC 4.2 failed to install for me several months ago (which was the previous reason for me failing to install and use GNUstep), and since it is not required for installation, I do not feel obliged to have it installed.
Forcing build system to use MP-GCC 4.4 resulted in a different behavior: configure phase completed successfully, but build phase kept using Apple's GCC 4.2.
Attachments (2)
Change History (12)
comment:1 Changed 14 years ago by ivan@…
Changed 14 years ago by ivan@…
log while building gnustep-base with apple's gcc-4.2
comment:2 Changed 14 years ago by IOOI-SqAR
The following is taken from a mail on the GNUstep discussion list here: http://lists.gnu.org/archive/html/discuss-gnustep/2011-01/msg00104.html
I added this to help the one who is going to fix the GNUstep ports
--8x---snip----------------------------------------
I have GNUstep running on OS X (Tiger and Leopard, though not Snow Leopard at present, using both Apple's gcc and gcc from MacPorts) for quite some time. Before Tiger I was using macports, but since the port got broken and was no longer maintained around that time, I set up my system from scratch then. Initially, I used gnustep-startup to get things working, but I haven't looked at it for a long time. So chances are that you may be able to set up your system with the help of gnustep-startup (probably with a few iterations to get all dependencies in place) but then maybe not.
The following tries to summarize the steps to get GNUstep working on OS X from scratch (as far as I remember them).
Note that I'm using the traditional GNUstep layout with everything installed in /usr/GNUstep. I haven't used the fhs layout, which is the default layout nowadays, and I'm not sure whether I would recommend using it in on OS X.
The steps below may or may not work for you. If they do, maybe someone could use them to update the MacPorts port?
- First install all dependencies as required by the GNUstep port in MacPorts For some ports you must be careful with the configuration so that they don't link (directly or indirectly) with Apple's CoreFoundation framework, which brings in Apple's libobjc. The ports you have to watch out for include (at least) aspell, fontconfig, and cairo. You *must* install the +nonls variant of aspell and you must install the +macosx variants of fontconfig and cairo.
- Decide whether you want to use Apple's C compiler or the MacPorts compiler
For Apple's C compiler continue at step 3), for the MacPorts compiler continue at step 7) - Configure and install gnustep-make
I'm using the latest source from svn at http://svn.gna.org/svn/gnustep/tools/make/trunk
./configure CFLAGS=-fno-constant-cfstrings \ --with-library-combo=gnu-gnu-gnu \ --with-config-file=/usr/GNUstep/GNUstep.conf \ --enable-absolute-install-paths sudo make install
Notes:
- --with-library-combo=gnu-gnu-gnu is mandatory, since apple-apple-apple is the default on OS X
- --with-config-file=... is optional. I like to have the config file in the same place as the rest of the installation, the default is to install in /etc/GNUstep. If that's okay for you omit this flag.
- --enable-absolute-install-paths is present so that you can run GNUstep applications and tools without sourcing /usr/GNUstep/System/Library/Makefiles/GNUstep.sh or /usr/GNUstep/System/Library/Makefiles/GNUstep.csh despite you a GNUstep file system layout. You may loose the ability to move applications and libraries around, though.
- At this point, source /usr/GNUstep/Makefiles/GNUstep.sh or /usr/GNUstep/Makefiles/GNUstep.csh:
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh (on bash/ksh) source /usr/GNUstep/System/Library/Makefiles/GNUstep.csh (on tcsh)
- Configure and install the GNU Objective-C runtime system (not the GNUstep Objective C runtime system; up to now I haven't been able to build it on OS X -- but then I didn't try very hard)
Again, I'm using the version from svn at http://svn.gna.org/svn/gnustep/libs/libobjc/trunk
sudo make install
This should install the headers in /usr/GNUstep/System/Library/Headers/objc and libobjc in /usr/GNUstep/System/Library/Libraries.
- Repeat step 3)
Yes, invoke configure again here. This is important so that GNUstep-make picks up that we now have the right Objective C library available.
After that continue at step 9)
- After you have installed the MacPorts compiler install gnustep-make
(cf. step 3) for the source)
./configure CC=gcc-mp-4.3 --with-library-combo=gnu-gnu-gnu \ --with-config-file=/usr/GNUstep/GNUstep.conf \ --enable-absolute-install-paths sudo make install
Note:
- See step 3) for the options supplied to configure
- CC=gcc-mp-4.3 sets the compiler being used. As you can see I'm (still) using Gnu C 4.3. Replace it by whatever you have installed.
- At this point, source /usr/GNUstep/Makefiles/GNUstep.sh or /usr/GNUstep/Makefiles/GNUstep.csh:
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh (on bash/ksh) source /usr/GNUstep/System/Library/Makefiles/GNUstep.csh (on tcsh)
- Make sure you have libffi installed. On my system, I see that I have installed libffi @gcc4.2.2_0. Don't know what is the current version in MacPorts, but I think it should work.
Also make sure that you really have sourced GNUstep.sh/GNUstep.csh (e.g., try echo $GNUSTEP_MAKEFILES, it should echo /usr/GNUstep/System/Library/Makefiles).
- Configure and install gnustep-base.
Not very surprisingly I'm using the version from svn at http://svn.gna.org/svn/gnustep/libs/base/trunk
If you are using the Apple compiler
./configure CFLAGS=-fno-constant-cfstrings \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib \ --disable-tls sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
If you are using the MacPorts compiler
./configure CC=gcc-mp-4.3 \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib \ --disable-tls sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
Notes:
- The arguments CFLAGS=-fno-constant-cfstrings and CC=gcc-mp-4.3 (or whatever MacPorts compiler is used) may be redundant (but they do not hurt either)
- CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib are necessary to find the libraries installed by MacPorts
- I use --disable-tls because I was unable to get it working when I set up my system and I do not need it at present. It may be possible to omit this flag with a more recent version from MacPorts.
- The complex sudo command is there to get the environment right for the root shell. Actually, if you have configured gnustep-make with --enable-absolute-install-paths, it should be possible to simply use sudo make install, but I've got used to the more complex command and didn't try that. (Since I build gnustep quite frequently, it is in my shell's history anyway.)
- Configure and install gnustep-gui
source is of course http://svn.gna.org/svn/gnustep/libs/gui/trunk
If you are using the Apple compiler
./configure CFLAGS=-fno-constant-cfstrings \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib \ --disable-cups --disable-sound sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
If you are using the MacPorts compiler
./configure CC=gcc-mp-4.3 \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib \ --disable-cups --disable-sound sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
Notes:
- For the compiler flags see step 10)
- --disable-cups and --disable-sound are mandatory; at least I was unable to install versions of these libraries from MacPorts that do not link with Apple's CoreFoundation framework.
- Configure and install gnustep-back
source from http://svn.gna.org/svn/gnustep/libs/back/trunk All three backend variants (art, cairo, xlib) are working for me. If you are using cairo, which is the default now, be sure to install the +macosx variant of cairo, which doesn't link against any Apple specific libraries. If you want to use the art backend, install the libart_lgpl port. Beware that in this case you most probably want to install additional fonts. I wouldn't recommend using the xlib backend.
If you are using the Apple compiler
./configure CFLAGS=-fno-constant-cfstrings \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib \ --disable-glx sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
If you are using the MacPorts compiler
./configure CC=gcc-mp-4.3 \ CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib \ --disable-glx sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
Notes:
- For the compiler flags see step 10)
- --disable-glx seems to be necessary. At least when I last tried to omit it, OpenGL was linking with Apple's libraries and bringing in Apple's CoreFoundation and Objective C runtime.
- If you want a different backend, add --enable-graphics=art or --enable-graphics=xlib to the configure options.
- Congratulations for getting this far.
Now you have a GNUstep installation on your system, but it is not clear whether this is a *working* installation. First try starting the GNUstep daemons. (If you are running under tcsh you have to execute rehash first).gdnc gpbs
If you don't get a crash report from OS X at this point, you were already quite successful. If you get a crash report (most likely from gpbs), have a look at the libraries linked with the executable (listed in the Binary Images section of the crash report file). If this includes libobjc.A.dylib (probably at the bottom), one of your dependencies was linked with Apple's libraries and the tough case is finding out which one. My experience is that this is a very tedious process, using otool -L to list the dependent libraries of each dynamic library that is linked with gnustep-gui and gnustep-base. Once, you've found that dependency, you need to find out a way to rebuild that dependency without linking to Apple's libraries.
- If you've got this far try installing a first GNUstep application.
I recommend using Ink for that purpose, as it is simple to install and a useful application by itself. It is not as complete as Apple's TextEdit, of course, but at least sufficiently capable to write simple texts like this one (I have to confess that I should have written this text with Ink but did type it right away into Mail). Source is in http://svn.gna.org/svn/gnustep/tests/examples/trunk/gui/Ink
Installation (as root) can be achieved with
sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"
If you prefer installing Ink in your private application directory instead use
make GNUSTEP_INSTALLATION_DIRECTORY=USER install
Now run Ink by typing
Ink(eventually after executing rehash first, if you are using tcsh). If you didn't get a crash report during the last step, Ink's menu and an empty document window should appear.
- Congratulations if you got here. You have successfully managed to install GNUstep on OS X.
From here on you should be able to install additional GNUstep applications in the same way as Ink.
Beware of some special cases though. The initial installation of some programs doesn't work out of the box, because the linker requires dependent frameworks to be installed in the (GNUstep) system directories. AFAIR, the problematic cases include SystemPreferences and ProjectCenter. To get SystemPreferences compiled and installed, first run
sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"from the PreferencePanes directory, then again from the main directory. Similarly, to get ProjectCenter compiled and installed, first run
sudo sh -c ". $GNUSTEP_MAKEFILES/GNUstep.sh; make install"from the Framework directory and then from the main directory. Similar issues may exist for other applications, but I don't remember those.
Hope this helps
Wolfgang
--8x---snap----------------------------------------
comment:4 Changed 14 years ago by bruggiero2@…
I'm pretty sure the issue is on the Portfile's 34th line:
configure.env-append LIBOBJC=-lobjc-gnu
Which is odd, because there is no library known as libobjc-gnu, only libobjc, so it should probably be:
configure.env-append LIBOBJC=-lobjc
I'm new to MacPorts, so I might be wrong, but that's my 2 cents.
comment:5 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
Everybody, please use WikiFormatting so your posts are legible. Lars, I have tried to correct your voluminous post's formatting, but appear to have only been partially successful.
Changed 13 years ago by LenoreHorner
Attachment: | main.2.log added |
---|
I can't seem to make objective c compiler work error
comment:8 Changed 12 years ago by raimue (Rainer Müller)
Somehow the gnustep port group expects different stuff than what is installed by the ports. For example, the gnustep port group expects ${prefix}/GNUstep/System/Library/Makefiles as a check for the GNUStep layout, which does not exist even when installing gnustep-make +gnustep_layout.
Also, the gnustep-config
binary was installed into ${prefix}/GNUStep/bin
on my system, while this is directory is not added to PATH in the port group. Subsequently, the gnustep-base port fails very early in the configure step as it cannot find the required gnustep-config.
comment:9 follow-up: 10 Changed 12 years ago by cooljeanius (Eric Gallager)
Also, the gnustep-config binary was installed into ${prefix}/GNUStep/bin on my system, while this is directory is not added to PATH in the port group. Subsequently, the gnustep-base port fails very early in the configure step as it cannot find the required gnustep-config.
This is the same error that I've been running into. Which would be a better solution: adding ${prefix}/GNUStep/bin
to the PATH that MacPorts can see, or symlinking gnustep-config
into the plain ${prefix}/bin
?
Replying to ivan@…:
Btw, forcing was done like this: