Commit e37ce851902af9a0c54508a693024ceaccf49abd

Authored by Jay Berkenbilt
1 parent 8ca46d1f

Clarify static vs. import library on Windows (fixes #225)

ChangeLog
  1 +2018-08-14 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * For the mingw builds, change the name of the DLL import library
  4 + from libqpdf.a to libqpdf.dll.a to avoid confusing it with a
  5 + static library. This potentially clears the way for supporting a
  6 + static library in the future, though presently, the qpdf Windows
  7 + build only builds the DLL and executables. Fixes #225.
  8 +
1 2018-08-13 Jay Berkenbilt <ejb@ql.org> 9 2018-08-13 Jay Berkenbilt <ejb@ql.org>
2 10
3 * Add new class QPDFSystemError, derived from std::runtime_error, 11 * Add new class QPDFSystemError, derived from std::runtime_error,
make/installwin.mk
1 DEST=$(INSTALL_DIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) 1 DEST=$(INSTALL_DIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
  2 +IMPORT_LIB_NAME := $(call libname,qpdf)
2 installwin: all 3 installwin: all
3 $(RM) -r $(INSTALL_DIR) 4 $(RM) -r $(INSTALL_DIR)
4 mkdir $(INSTALL_DIR) 5 mkdir $(INSTALL_DIR)
@@ -8,7 +9,7 @@ installwin: all @@ -8,7 +9,7 @@ installwin: all
8 mkdir $(DEST)/include 9 mkdir $(DEST)/include
9 mkdir $(DEST)/include/qpdf 10 mkdir $(DEST)/include/qpdf
10 mkdir $(DEST)/doc 11 mkdir $(DEST)/doc
11 - cp libqpdf/$(OUTPUT_DIR)/$(STATIC_LIB_NAME) $(DEST)/lib 12 + cp libqpdf/$(OUTPUT_DIR)/$(IMPORT_LIB_NAME) $(DEST)/lib
12 cp libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin 13 cp libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin
13 perl copy_dlls libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin $(OBJDUMP) $(WINDOWS_WORDSIZE) 14 perl copy_dlls libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin $(OBJDUMP) $(WINDOWS_WORDSIZE)
14 cp qpdf/$(OUTPUT_DIR)/qpdf.exe $(DEST)/bin 15 cp qpdf/$(OUTPUT_DIR)/qpdf.exe $(DEST)/bin
make/mingw.mk
@@ -5,7 +5,7 @@ LOBJ=o @@ -5,7 +5,7 @@ LOBJ=o
5 5
6 # Usage: $(call libname,base) 6 # Usage: $(call libname,base)
7 define libname 7 define libname
8 -lib$(1).a 8 +lib$(1).dll.a
9 endef 9 endef
10 10
11 # Usage: $(call binname,base) 11 # Usage: $(call binname,base)
@@ -62,8 +62,8 @@ endef @@ -62,8 +62,8 @@ endef
62 # 1 2 3 4 5 6 7 62 # 1 2 3 4 5 6 7
63 # Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age) 63 # Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age)
64 define makelib 64 define makelib
65 - $(DLLTOOL) -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(shell expr $(5) - $(7)).dll) $(1); \  
66 - $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(shell expr $(5) - $(7)).dll \ 65 + $(DLLTOOL) -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).dll.a,/\1,'`$(shell expr $(5) - $(7)).dll) $(1); \
  66 + $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).dll.a,/\1,'`$(shell expr $(5) - $(7)).dll \
67 $(1) $(3) $(4) 67 $(1) $(3) $(4)
68 endef 68 endef
69 69
@@ -76,7 +76,6 @@ endef @@ -76,7 +76,6 @@ endef
76 # Install target 76 # Install target
77 77
78 INSTALL_DIR = install-mingw$(WINDOWS_WORDSIZE) 78 INSTALL_DIR = install-mingw$(WINDOWS_WORDSIZE)
79 -STATIC_LIB_NAME = libqpdf.a  
80 include make/installwin.mk 79 include make/installwin.mk
81 install: installwin 80 install: installwin
82 $(STRIP) $(DEST)/bin/*.exe 81 $(STRIP) $(DEST)/bin/*.exe
make/msvc.mk
@@ -92,6 +92,5 @@ endef @@ -92,6 +92,5 @@ endef
92 # Install target 92 # Install target
93 93
94 INSTALL_DIR = install-msvc$(WINDOWS_WORDSIZE) 94 INSTALL_DIR = install-msvc$(WINDOWS_WORDSIZE)
95 -STATIC_LIB_NAME = qpdf.lib  
96 include make/installwin.mk 95 include make/installwin.mk
97 install: installwin 96 install: installwin