| libcfg+ - Viewing Bug Advanced Details | [ Go Back ] | ||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 196 | building stuff | major | always | 2004-03-07 03:57 | 2010-11-07 22:31 |
|
|
|||||
| Reporter: | ejalbert | Platform: | PowerPC | ||
| Assigned To: | OS: | Mac OS X | |||
| Priority: | normal | Version: | 10.3.2 | ||
| Status: | feedback | Product Version: | 0.6.2 (stable) | ||
| Product Build: | N/A | Resolution: | open | ||
| Projection: | none | Duplicate ID: | |||
| ETA: | none | ||||
|
|
|||||
| 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 | ||||
|
|
||||
|
|
|||
|
|
||||
|
|
|||