Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Sunday, November 8, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  libcfg+  »  Bug list  »  Bug #196

Viewing Bug Advanced Details [ Jump to Bugnotes ] [ Bug History ] [ Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000196 building stuff major always 2004-03-07 03:57 2010-11-07 22:31
 
Reporter ejalbert View Status public  
Assigned To
Priority normal Resolution open Platform PowerPC
Status feedback Duplicate ID OS Mac OS X
Projection none Version 10.3.2
ETA none Product Version 0.6.2 (stable)
  Product Build N/A
  Votes 1
 
Summary Doesn't build on Mac OS X
Description On Apple's unix-porting list, Marco Baroni (baroni@sslmit.unibo.it) reported that libcfg+-0.6.2 didn't compile on Mac OS X. I was curious, so I took a look and fixed it, albeit not in a way that'll work with your autoconf setup. That'll take a little bit of tweaking.
Steps To Reproduce On Mac OS X, grab the code and run ./configure && make. You'll see this:

ld -shared -o libcfg+.so.0.6.2 ../src/cfg+.o ../src/parse.o ../src/props.o ../src/cmdline.o ../src/cfgfile.o ../src/shared.o ../src/platon/str/strplus.o ../src/platon/str/strctype.o ../src/platon/str/strdyn.o ../src/platon/str/dynfgets.o
ld: unknown flag: -shared
make[1]: *** [libcfg+.so.0.6.2] Error 1
make: *** [all-src] Error 2
Additional Information / Solution There are two problems:
1) Mac OS X uses '.dylib' as its shared library extension, not '.so'.
2) Mac OS X's ld doesn't understand '-shared'. You need to use '-dylib', but that introduces some other complications so it's easier to link with gcc and use '-dynamiclib'.

Here are my diffs. I think the change from $(LD) to $(CC) should be portable, but the use of the -dynamiclib flag and the reworking of the library extension will have to be autoconf'd.

diff -r -u -d -b -w libcfg+-0.6.2/Rules.make.in libcfg+-0.6.2-fixed/Rules.make.in
--- libcfg+-0.6.2/Rules.make.in Tue Feb 17 08:37:47 2004
+++ libcfg+-0.6.2-fixed/Rules.make.in Sat Mar 6 18:42:19 2004
@@ -24,8 +24,8 @@
DISTFILES +=

LIBSTATIC = $(PACKAGE).a
-LIBDYNAMIC = $(PACKAGE).so
-LIBDYNAMICV = $(PACKAGE).so.$(VERSION)
+LIBDYNAMIC = $(PACKAGE).dylib
+LIBDYNAMICV = $(PACKAGE).$(VERSION).dylib

install_LIB = $(LIBSTATIC) $(LIBDYNAMICV)
SCRIPTS =
@@ -160,7 +160,7 @@
$(AR) r $@ $(OBJECTS)

$(LIBDYNAMICV): $(OBJECTS)
- $(LD) $(LDFLAGS) -shared -o $@ $(OBJECTS)
+ $(CC) $(LDFLAGS) -dynamiclib -o $@ $(OBJECTS)

%.o: %.c $(CONFIG_HEADER)
@echo '$(COMPILE) -c $<'; \
diff -r -u -d -b -w libcfg+-0.6.2/src/Makefile.in libcfg+-0.6.2-fixed/src/Makefile.in
--- libcfg+-0.6.2/src/Makefile.in Tue Feb 17 08:37:47 2004
+++ libcfg+-0.6.2-fixed/src/Makefile.in Sat Mar 6 18:40:36 2004
@@ -97,8 +97,8 @@
platon/str/strplus.h

LIBSTATIC = $(PACKAGE).a
-LIBDYNAMIC = $(PACKAGE).so
-LIBDYNAMICV = $(PACKAGE).so.$(VERSION)
+LIBDYNAMIC = $(PACKAGE).dylib
+LIBDYNAMICV = $(PACKAGE).$(VERSION).dylib

install_LIB = $(LIBSTATIC) $(LIBDYNAMICV)

Attached Files

Bug Notes
admin
2004-03-08 10:32

Thank you for your bug report.

However we cannot apply your patch, because library will no longer compile on our UNIX system. However we definitely want to add support also for Mac OS X. So if posssible, send you such patch, which will add support for this system. We have no access to Mac OS X, so we will try only if UNIX build is still working properly and believe, that added Mac OS X support works as well.

You can upload files/patches in this bug-tracking system.
 
chrispix
2010-11-07 22:31

The diffs above for linking with gcc worked great for me on OS X Snow Leopard. Thanks!
 

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy