# HG changeset patch # User jbe # Date 1571490355 -7200 # Node ID 72e55c2eb63c44e446855019526d604e7eba4983 # Parent d0104bb90ede8a01a016767cd448548f7d446479 Use "cc -shared" instead of "ld -shared" to create *.so files diff -r d0104bb90ede -r 72e55c2eb63c Makefile.options --- a/Makefile.options Sat Oct 12 20:35:00 2019 +0200 +++ b/Makefile.options Sat Oct 19 15:05:55 2019 +0200 @@ -1,9 +1,6 @@ # C compiler command CC = cc -# linker command -LD = ld - # filename extension for shared libraries SLIB_EXT = so @@ -19,9 +16,9 @@ # additional C compiler flags for parts which depend on PostgreSQL CFLAGS_PGSQL = -I `pg_config --includedir` -I `pg_config --pkgincludedir` -I `pg_config --includedir-server` -# linker flags -LDFLAGS = -shared -L /usr/lib -L /usr/local/lib -lc +# alternative C compiler flags for creating shared libraries +SHAREDFLAGS = -shared -L /usr/lib -L /usr/local/lib -lc # NOTE: -lc needed on FreeBSD to avoid weird problems -# additional linker flags for parts which depend on PostgreSQL -LDFLAGS_PGSQL = -L `pg_config --libdir` -rpath `pg_config --libdir` +# additional C compiler flags for creating shared libraries for parts which depend on PostgreSQL +SHAREDFLAGS_PGSQL = -L `pg_config --libdir` -Wl,--rpath,`pg_config --libdir` diff -r d0104bb90ede -r 72e55c2eb63c framework/accelerator/Makefile --- a/framework/accelerator/Makefile Sat Oct 12 20:35:00 2019 +0200 +++ b/framework/accelerator/Makefile Sat Oct 19 15:05:55 2019 +0200 @@ -1,7 +1,7 @@ include ../../Makefile.options webmcp_accelerator.so: webmcp_accelerator.o - $(LD) $(LDFLAGS) -o webmcp_accelerator.$(SLIB_EXT) webmcp_accelerator.o + $(CC) $(SHAREDFLAGS) -o webmcp_accelerator.$(SLIB_EXT) webmcp_accelerator.o webmcp_accelerator.o: webmcp_accelerator.c $(CC) -c $(CFLAGS) -o webmcp_accelerator.o webmcp_accelerator.c diff -r d0104bb90ede -r 72e55c2eb63c libraries/extos/Makefile --- a/libraries/extos/Makefile Sat Oct 12 20:35:00 2019 +0200 +++ b/libraries/extos/Makefile Sat Oct 19 15:05:55 2019 +0200 @@ -1,7 +1,7 @@ include ../../Makefile.options extos.so: extos.o - $(LD) $(LDFLAGS) -lrt -lcrypt -o extos.$(SLIB_EXT) extos.o + $(CC) $(SHAREDFLAGS) -lrt -lcrypt -o extos.$(SLIB_EXT) extos.o extos.o: extos.c $(CC) -c $(CFLAGS) -o extos.o extos.c diff -r d0104bb90ede -r 72e55c2eb63c libraries/json/Makefile --- a/libraries/json/Makefile Sat Oct 12 20:35:00 2019 +0200 +++ b/libraries/json/Makefile Sat Oct 19 15:05:55 2019 +0200 @@ -1,7 +1,7 @@ include ../../Makefile.options json.so: json.o - $(LD) $(LDFLAGS) -o json.$(SLIB_EXT) json.o + $(CC) $(SHAREDFLAGS) -o json.$(SLIB_EXT) json.o json.o: json.c $(CC) -c $(CFLAGS) -o json.o json.c diff -r d0104bb90ede -r 72e55c2eb63c libraries/mondelefant/Makefile --- a/libraries/mondelefant/Makefile Sat Oct 12 20:35:00 2019 +0200 +++ b/libraries/mondelefant/Makefile Sat Oct 19 15:05:55 2019 +0200 @@ -1,7 +1,7 @@ include ../../Makefile.options mondelefant_native.so: mondelefant_native.o - $(LD) $(LDFLAGS) $(LDFLAGS_PGSQL) -o mondelefant_native.$(SLIB_EXT) mondelefant_native.o -lpq + $(CC) $(SHAREDFLAGS) $(SHAREDFLAGS_PGSQL) -o mondelefant_native.$(SLIB_EXT) mondelefant_native.o -lpq mondelefant_native.o: mondelefant_native.c $(CC) -c $(CFLAGS) $(CFLAGS_PGSQL) -o mondelefant_native.o mondelefant_native.c diff -r d0104bb90ede -r 72e55c2eb63c libraries/moonhash/Makefile --- a/libraries/moonhash/Makefile Sat Oct 12 20:35:00 2019 +0200 +++ b/libraries/moonhash/Makefile Sat Oct 19 15:05:55 2019 +0200 @@ -1,7 +1,7 @@ include ../../Makefile.options moonhash.so: moonhash.o - $(LD) $(LDFLAGS) -o moonhash.so moonhash.o + $(CC) $(SHAREDFLAGS) -o moonhash.so moonhash.o moonhash.o: moonhash.c moonhash_sha3.c $(CC) -c $(CFLAGS) -o moonhash.o moonhash.c diff -r d0104bb90ede -r 72e55c2eb63c libraries/multirand/Makefile --- a/libraries/multirand/Makefile Sat Oct 12 20:35:00 2019 +0200 +++ b/libraries/multirand/Makefile Sat Oct 19 15:05:55 2019 +0200 @@ -1,7 +1,7 @@ include ../../Makefile.options multirand.so: multirand.o - $(LD) $(LDFLAGS) -o multirand.$(SLIB_EXT) multirand.o + $(CC) $(SHAREDFLAGS) -o multirand.$(SLIB_EXT) multirand.o multirand.o: multirand.c $(CC) -c $(CFLAGS) -o multirand.o multirand.c