]> git.tuebingen.mpg.de Git - osl.git/blobdiff - Makefile
Simply use the major version of the lib also on MacOS.
[osl.git] / Makefile
index 4e8b48e8aedfc673f7c97a2566b0909272c5dad8..7204f88f535053b622048fbb1a0a2b0d80889674 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,10 +13,9 @@ ifeq ($(uname_s),Linux)
        dso_filename :=lib$(libname).so.$(major_version).$(minor_version).$(patchlevel_version)
 endif
 ifeq ($(uname_s),Darwin)
-       mac_major_version := $(shell expr 41 + $(major_version))
        dso_opts := -dynamiclib -current_version $(major_version).$(minor_version) \
                -compatibility_version $(major_version).$(minor_version) -fvisibility=hidden
-       dso_filename := lib$(libname).$(shell printf "\\x"$(mac_major_version).dylib)
+       dso_filename := lib$(libname).$(major_version)
 endif
 ifeq ($(uname_s),SunOS)
        dso_opts := --shared -z text -z defs
@@ -33,11 +32,14 @@ ifeq ($(uname_s),NetBSD)
 endif
 all: $(dso_filename)
 
+# disallow undefined symbols
+LDFLAGS += -Wl,-z,defs
+
 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
 DEBUG_CPPFLAGS += -Wredundant-decls
-#CPPFLAGS += -Os
+CPPFLAGS += -Os
 CPPFLAGS += -Wall
-#CPPFLAGS += -Wuninitialized
+CPPFLAGS += -Wuninitialized
 CPPFLAGS += -Wchar-subscripts
 CPPFLAGS += -Wformat-security
 CPPFLAGS += -Werror-implicit-function-declaration
@@ -55,7 +57,7 @@ Makefile.deps: $(wildcard *.c *.h)
 %.o: %.c Makefile
        $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
 $(dso_filename): $(objects)
-       $(CC) $(dso_opts) -o $@ $(objects) -lcrypto
+       $(CC) $(dso_opts) -o $@ $(objects) $(LDFLAGS) -lcrypto
 
 osl_errors.h: errlist
        sed -e 's/\([A-Z_]*\)   .*/     E_OSL_\1/' \