Skip to content

Commit

Permalink
Clarify static vs. import library on Windows (fixes #225)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkenbilt committed Aug 14, 2018
1 parent 8ca46d1 commit e37ce85
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion make/installwin.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions make/mingw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LOBJ=o

# Usage: $(call libname,base)
define libname
lib$(1).a
lib$(1).dll.a
endef

# Usage: $(call binname,base)
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion make/msvc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,5 @@ endef
# Install target

INSTALL_DIR = install-msvc$(WINDOWS_WORDSIZE)
STATIC_LIB_NAME = qpdf.lib
include make/installwin.mk
install: installwin

0 comments on commit e37ce85

Please sign in to comment.