--- a/makelib/config.make Tue Jun 19 21:26:26 2018 +0100
+++ b/makelib/config.make Thu Jun 21 08:07:41 2018 +0000
@@ -87,7 +87,7 @@
# c-compiler to use
CC ?= cc
-AS_CC ?= $(CC)
+AS_CC ?= $(CC) $(CCCONFOPT)
AS_CC_CFLAG=-c
CPP = cpp
@@ -95,8 +95,13 @@
AS = as
# linker for final executable
-LD = $(CC)
-# linker for classlibs
+LD = $(CC) $(CCCONFOPT)
+LDFLAGS = $(CCCONFOPT) \
+ -Llib -L/usr/local/lib -L/usr/X11/lib -L/usr/lib \
+ -Wl,-z,now,-Bsymbolic,-rpath,'$$ORIGIN',-rpath,'$$ORIGIN/lib',-rpath,'$$ORIGIN/../lib'
+
+# linker for classlib object files, i.e., for example libstx_libbasic.o. This single partially-linked
+# object file is later linked into a shared library.
CLASSLIB_LD=ld
# lex (can be replaced by flex)
@@ -233,7 +238,7 @@
# default is to use the same compiler as for classes
STC_CC=$(CC)
-STC_LD=$(STC_CC)
+STC_LD=$(LD)
STC_CFLAGS=$(CFLAGS)
STC_LEXLIB=-ll
@@ -453,7 +458,7 @@
#
# OTHERLIBS are libraries to be linked in at the end
#
-OTHERLIBS =
+OTHERLIBS = -ldl -lrt -lc
MAIN = $(LIBRUNDIR)/main.c
#HIDATA = $(LIBRUNDIR)/hidata.o
@@ -522,12 +527,14 @@
ZLIB_DIR=$(TOP)/support/zlib-1.2.3
ZLIB_LD_ARG=-L$(ZLIB_DIR) -lz
ZLIB_MAKE_TARGET=zlib
+MAKE_ZLIB_ARG= "CFLAGS=$(CCCONFOPT) -fPIC -O3 -DUSE_MMAP"
# the following defs are for using the provided (not the system) bz2lib;
# should work everywhere
BZ2LIB_DIR=$(TOP)/support/bz2lib
BZ2LIB_LD_ARG=-L$(BZ2LIB_DIR) -lbz2
BZ2LIB_MAKE_TARGET=bz2lib
+MAKE_BZ2LIB_ARG= "CC=$(CC) $(CCCONFOPT)"
# the following defs are for NOT using any usb lib (only needed in some apps);
# redefined in linux configurations, to use the system lib (-lusb)