aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--config.mk4
-rw-r--r--mk/linux.mk2
-rw-r--r--mk/macos.mk4
-rw-r--r--mk/windows.mk4
5 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 978519e..57da740 100644
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,7 @@ $(LOBJ): $(HDR)
libfonts.a: $(OBJ)
@rm -f -- $@
$(AR) rc $@ $(OBJ)
+ $(AR) ts $@ > /dev/null
libfonts.$(LIBEXT): $(LOBJ)
$(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS)
@@ -50,6 +51,7 @@ install: libfonts.a libfonts.$(LIBEXT)
mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
cp -- libfonts.a "$(DESTDIR)$(PREFIX)/lib/"
cp -- libfonts.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMINOREXT)"
+ $(FIX_INSTALL_NAME) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMINOREXT)"
ln -sf -- libfonts.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMAJOREXT)"
ln -sf -- libfonts.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBEXT)"
cp -- libfonts.h "$(DESTDIR)$(PREFIX)/include/"
diff --git a/config.mk b/config.mk
index 9b16e1d..ab163d4 100644
--- a/config.mk
+++ b/config.mk
@@ -1,8 +1,8 @@
PREFIX = /usr
MANPREFIX = $(PREFIX)/share/man
-CC = cc
+CC = c99
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
-CFLAGS = -std=c99 -Wall -g
+CFLAGS = -Wall -g
LDFLAGS =
diff --git a/mk/linux.mk b/mk/linux.mk
index d016d31..ad58f69 100644
--- a/mk/linux.mk
+++ b/mk/linux.mk
@@ -2,3 +2,5 @@ LIBEXT = so
LIBFLAGS = -shared -Wl,-soname,lib$(LIB_NAME).$(LIBEXT).$(LIB_MAJOR)
LIBMAJOREXT = $(LIBEXT).$(LIB_MAJOR)
LIBMINOREXT = $(LIBEXT).$(LIB_VERSION)
+
+FIX_INSTALL_NAME = :
diff --git a/mk/macos.mk b/mk/macos.mk
index bd92de6..0138ee4 100644
--- a/mk/macos.mk
+++ b/mk/macos.mk
@@ -1,4 +1,6 @@
LIBEXT = dylib
-LIBFLAGS = -dynamiclib
+LIBFLAGS = -dynamiclib -Wl,-compatibility_version,$(LIB_MAJOR) -Wl,-current_version,$(LIB_VERSION)
LIBMAJOREXT = $(LIB_MAJOR).$(LIBEXT)
LIBMINOREXT = $(LIB_VERSION).$(LIBEXT)
+
+FIX_INSTALL_NAME = install_name_tool -id "$(PREFIX)/lib/libfonts.$(LIBMAJOREXT)"
diff --git a/mk/windows.mk b/mk/windows.mk
index e9602e1..ed5ec8d 100644
--- a/mk/windows.mk
+++ b/mk/windows.mk
@@ -1,4 +1,6 @@
LIBEXT = dll
-LIBFLAGS = -mdll
+LIBFLAGS = -shared
LIBMAJOREXT = $(LIB_MAJOR).$(LIBEXT)
LIBMINOREXT = $(LIB_VERSION).$(LIBEXT)
+
+FIX_INSTALL_NAME = :