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

This commit is contained in:
Jay Berkenbilt 2018-08-14 16:28:52 -04:00
parent 8ca46d1ff0
commit e37ce85190
4 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2018-08-14 Jay Berkenbilt <ejb@ql.org>
* For the mingw builds, change the name of the DLL import library
from libqpdf.a to libqpdf.dll.a to avoid confusing it with a
static library. This potentially clears the way for supporting a
static library in the future, though presently, the qpdf Windows
build only builds the DLL and executables. Fixes #225.
2018-08-13 Jay Berkenbilt <ejb@ql.org>
* Add new class QPDFSystemError, derived from std::runtime_error,

View File

@ -1,4 +1,5 @@
DEST=$(INSTALL_DIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
IMPORT_LIB_NAME := $(call libname,qpdf)
installwin: all
$(RM) -r $(INSTALL_DIR)
mkdir $(INSTALL_DIR)
@ -8,7 +9,7 @@ installwin: all
mkdir $(DEST)/include
mkdir $(DEST)/include/qpdf
mkdir $(DEST)/doc
cp libqpdf/$(OUTPUT_DIR)/$(STATIC_LIB_NAME) $(DEST)/lib
cp libqpdf/$(OUTPUT_DIR)/$(IMPORT_LIB_NAME) $(DEST)/lib
cp libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin
perl copy_dlls libqpdf/$(OUTPUT_DIR)/qpdf*.dll $(DEST)/bin $(OBJDUMP) $(WINDOWS_WORDSIZE)
cp qpdf/$(OUTPUT_DIR)/qpdf.exe $(DEST)/bin

View File

@ -5,7 +5,7 @@ LOBJ=o
# Usage: $(call libname,base)
define libname
lib$(1).a
lib$(1).dll.a
endef
# Usage: $(call binname,base)
@ -62,8 +62,8 @@ endef
# 1 2 3 4 5 6 7
# Usage: $(call makelib,objs,library,ldflags,libs,current,revision,age)
define makelib
$(DLLTOOL) -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(shell expr $(5) - $(7)).dll) $(1); \
$(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(shell expr $(5) - $(7)).dll \
$(DLLTOOL) -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).dll.a,/\1,'`$(shell expr $(5) - $(7)).dll) $(1); \
$(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).dll.a,/\1,'`$(shell expr $(5) - $(7)).dll \
$(1) $(3) $(4)
endef
@ -76,7 +76,6 @@ endef
# Install target
INSTALL_DIR = install-mingw$(WINDOWS_WORDSIZE)
STATIC_LIB_NAME = libqpdf.a
include make/installwin.mk
install: installwin
$(STRIP) $(DEST)/bin/*.exe

View File

@ -92,6 +92,5 @@ endef
# Install target
INSTALL_DIR = install-msvc$(WINDOWS_WORDSIZE)
STATIC_LIB_NAME = qpdf.lib
include make/installwin.mk
install: installwin