shared library

Mark Brethen mark.brethen at
Sat Dec 1 19:13:39 UTC 2018

Spooles does not have config files, so I’m passing the env during build. I used ld to create the dylib from the static library:

--- spooles.2.2.orig/MT/src/makeGlobalLib       1998-09-17 14:25:59.000000000 -0500
+++ spooles.2.2/MT/src/makeGlobalLib    2018-12-01 09:25:00.000000000 -0600
@@ -19,3 +19,4 @@
        $(AR) $(ARFLAGS) ../../spooles.a $(OBJ)_*.o
        rm -f $(OBJ)_*.o
        $(RANLIB) ../../spooles.a
+       ld ../../spooles.a -dylib @@LDARCHFLAGS@@ -x -install_name @@PREFIX@@/lib/libspooles.1.dylib -compatibility_version 2.0 -current_version @@VERSION@@ -o ../../libspooles.1.dylib

When I check the symbol table using nm, its empty. So I took a look at the build log to see what args are passed, for example:

:info:build make[1]: Entering directory `/opt/local/var/macports/build/_Users_marbre_ports_math_spooles/spooles/work/spooles.2.2/BKL/src'
:info:build /usr/bin/clang -c -Os basics.c -o BKL_basics.o
:info:build /usr/bin/clang -c -Os evalfcn.c -o BKL_evalfcn.o
:info:build /usr/bin/clang -c -Os exhSearch.c -o BKL_exhSearch.o
:info:build /usr/bin/clang -c -Os fidmat.c -o BKL_fidmat.o
:info:build /usr/bin/clang -c -Os init.c -o BKL_init.o
:info:build /usr/bin/clang -c -Os util.c -o BKL_util.o
:info:build ar rv ../../spooles.a BKL_*.o
:info:build a - BKL_basics.o
:info:build a - BKL_evalfcn.o
:info:build a - BKL_exhSearch.o
:info:build a - BKL_fidmat.o
:info:build a - BKL_init.o
:info:build a - BKL_util.o
:info:build rm -f BKL_*.o
:info:build ranlib ../../spooles.a

Don't the objects need to be compiled with the -dynamic flag?

Mark Brethen
mark.brethen at

More information about the macports-dev mailing list