<commit_before>--- Makefile.orig	2020-03-25 11:02:34.874709800 -0500
+++ Makefile	2020-04-06 16:00:50.247572934 -0500
@@ -20,7 +20,7 @@
 # Do not specify CFLAGS or LIBS on the make invocation line - specify
 # XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
 # set a variable that was set on the command line.
-CFLAGS += $(XCFLAGS) -Iinclude
+CFLAGS += $(XCFLAGS) -Iinclude -fPIC
 LIBS += $(XLIBS) -lm
 
 ifneq ($(threading),no)
@@ -189,17 +189,21 @@
 
 # --- Library ---
 
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdf-third.a
-THREAD_LIB = $(OUT)/libmupdf-threads.a
-PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
+MUPDF_LIB = $(OUT)/libmupdf.dylib
+THIRD_LIB = $(OUT)/libmupdf-third.dylib
+THREAD_LIB = $(OUT)/libmupdf-threads.dylib
+PKCS7_LIB = $(OUT)/libmupdf-pkcs7.dylib
 
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf.dylib -Wl,--no-undefined $(THIRD_LIBS)
 $(THIRD_LIB) : $(THIRD_OBJ)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf-third.dylib -Wl,--no-undefined
 $(THREAD_LIB) : $(THREAD_OBJ)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf-threads.dylib -Wl,--no-undefined -lpthread
 $(PKCS7_LIB) : $(PKCS7_OBJ)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf-pkcs7.dylib
 
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB)
 
 # --- Main tools and viewers ---
 <commit_msg>one hyph<commit_after>--- Makefile.orig	2020-03-25 11:02:34.874709800 -0500
+++ Makefile	2020-04-06 16:28:05.321398219 -0500
@@ -20,7 +20,7 @@
 # Do not specify CFLAGS or LIBS on the make invocation line - specify
 # XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
 # set a variable that was set on the command line.
-CFLAGS += $(XCFLAGS) -Iinclude
+CFLAGS += $(XCFLAGS) -Iinclude -fPIC
 LIBS += $(XLIBS) -lm
 
 ifneq ($(threading),no)
@@ -189,17 +189,21 @@
 
 # --- Library ---
 
-MUPDF_LIB = $(OUT)/libmupdf.a
-THIRD_LIB = $(OUT)/libmupdf-third.a
-THREAD_LIB = $(OUT)/libmupdf-threads.a
-PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
+MUPDF_LIB = $(OUT)/libmupdf.dylib
+THIRD_LIB = $(OUT)/libmupdf-third.dylib
+THREAD_LIB = $(OUT)/libmupdf-threads.dylib
+PKCS7_LIB = $(OUT)/libmupdf-pkcs7.dylib
 
-$(MUPDF_LIB) : $(MUPDF_OBJ)
+$(MUPDF_LIB) : $(MUPDF_OBJ) $(THIRD_LIB) $(THREAD_LIB)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf.dylib -Wl,-no-undefined $(THIRD_LIBS)
 $(THIRD_LIB) : $(THIRD_OBJ)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf-third.dylib -Wl,-no-undefined
 $(THREAD_LIB) : $(THREAD_OBJ)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf-threads.dylib -Wl,-no-undefined -lpthread
 $(PKCS7_LIB) : $(PKCS7_OBJ)
+	$(LINK_CMD) -shared -Wl,-install_name -Wl,libmupdf-pkcs7.dylib
 
-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB)
 
 # --- Main tools and viewers ---
 
{'fraction_non_alphanumeric': 0.1888135593220339, 'fraction_numerical': 0.05288135593220339, 'mean_word_length': 4.29802513464991, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6805829', 'n_tokens_mistral': 1435, 'n_tokens_neox': 1272, 'n_words': 243}