Commit 7398ef88b78d04b1428ed6336325a89f55117841

Authored by Jay Berkenbilt
1 parent 6e193e31

further refinements to build

git-svn-id: svn+q:///qpdf/trunk@759 71b93d88-0707-0410-a8cf-f5a4172ac649
Makefile
@@ -54,7 +54,7 @@ endif @@ -54,7 +54,7 @@ endif
54 54
55 #XXX 55 #XXX
56 ##BUILDRULES := libtool 56 ##BUILDRULES := libtool
57 -BUILDRULES := gcc 57 +BUILDRULES := gcc-linux
58 58
59 # Prevent gnu make from trying to rebuild .dep files 59 # Prevent gnu make from trying to rebuild .dep files
60 $(foreach B,$(BUILD_ITEMS),$(eval \ 60 $(foreach B,$(BUILD_ITEMS),$(eval \
README.windows
@@ -10,3 +10,8 @@ Must add libqpdf/build to PATH. @@ -10,3 +10,8 @@ Must add libqpdf/build to PATH.
10 To debug a crash in MSVC's debugger, start an instance of Visual C++. 10 To debug a crash in MSVC's debugger, start an instance of Visual C++.
11 When the abort/retry/ignore dialog pops up, first attach the process 11 When the abort/retry/ignore dialog pops up, first attach the process
12 from within visual C++, and then click Retry. 12 from within visual C++, and then click Retry.
  13 +
  14 +Basic procedure for building with mingw is to run configure and build
  15 +in msys and then run the test suite in cygwin with GENDEPS=0.
  16 +
  17 +Also have to deal with gcc runtime DLL.
libqpdf/build.mk
1 -TARGETS_libqpdf = \  
2 - $(foreach L,$(call libname,qpdf),libqpdf/$(OUTPUT_DIR)/$(L)) 1 +TARGETS_libqpdf = libqpdf/$(OUTPUT_DIR)/$(call libname,qpdf)
3 2
4 INCLUDES_libqpdf = include libqpdf 3 INCLUDES_libqpdf = include libqpdf
5 4
make/gcc-linux.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 lib$(1).so 8 +lib$(1).so
9 endef 9 endef
10 10
11 # Usage: $(call binname,base) 11 # Usage: $(call binname,base)
@@ -41,22 +41,25 @@ define libcompile @@ -41,22 +41,25 @@ define libcompile
41 endef 41 endef
42 42
43 43
  44 +# 1 2
  45 +# Usage: $(call makeslib,objs,library)
  46 +define makeslib
  47 + $(RM) $2
  48 + ar cru $(2) $(1)
  49 + ranlib $(2)
  50 +endef
  51 +
44 # 1 2 3 4 5 52 # 1 2 3 4 5
45 # Usage: $(call makelib,objs,library,current,revision,age) 53 # Usage: $(call makelib,objs,library,current,revision,age)
46 define makelib 54 define makelib
47 $(RM) $2 55 $(RM) $2
48 - if [ "$(findstring .a,$(2))" = ".a" ]; then \  
49 - ar cru $(2) $(1); \  
50 - ranlib $(2); \  
51 - else \  
52 - major=$$(( $(3) - $(5))); \  
53 - versuffix=$$major.$5.$4; \  
54 - $(CXX) $(CXXFLAGS) -shared -o $(2).$$versuffix $(1) \  
55 - -Wl,--soname -Wl,`basename $(2)`.$$major \  
56 - $(LDFLAGS) $(LIBS); \  
57 - ln -s `basename $(2)`.$$versuffix $(2); \  
58 - ln -s `basename $(2)`.$$versuffix $(2).$$major; \  
59 - fi 56 + major=$$(( $(3) - $(5))); \
  57 + versuffix=$$major.$5.$4; \
  58 + $(CXX) $(CXXFLAGS) -shared -o $(2).$$versuffix $(1) \
  59 + -Wl,--soname -Wl,`basename $(2)`.$$major \
  60 + $(LDFLAGS) $(LIBS); \
  61 + ln -s `basename $(2)`.$$versuffix $(2); \
  62 + ln -s `basename $(2)`.$$versuffix $(2).$$major
60 endef 63 endef
61 64
62 # 1 2 65 # 1 2
make/libtool.mk
@@ -57,6 +57,14 @@ define libcompile @@ -57,6 +57,14 @@ define libcompile
57 $(call fixdeps,$(basename $(call src_to_obj,$(1)))) 57 $(call fixdeps,$(basename $(call src_to_obj,$(1))))
58 endef 58 endef
59 59
  60 +# 1 2
  61 +# Usage: $(call makeslib,objs,library)
  62 +define makeslib
  63 + $(RM) $2
  64 + ar cru $(2) $(1)
  65 + ranlib $(2)
  66 +endef
  67 +
60 # 1 2 3 4 5 68 # 1 2 3 4 5
61 # Usage: $(call makelib,objs,library,current,revision,age) 69 # Usage: $(call makelib,objs,library,current,revision,age)
62 define makelib 70 define makelib
make/mingw.mk
@@ -35,11 +35,17 @@ endef @@ -35,11 +35,17 @@ endef
35 35
36 libcompile = $(compile) 36 libcompile = $(compile)
37 37
  38 +# 1 2
  39 +# Usage: $(call makeslib,objs,library)
  40 +define makeslib
  41 + $(RM) $2
  42 + ar cru $(2) $(1)
  43 + ranlib $(2)
  44 +endef
  45 +
38 # 1 2 3 4 5 46 # 1 2 3 4 5
39 # Usage: $(call makelib,objs,library,current,revision,age) 47 # Usage: $(call makelib,objs,library,current,revision,age)
40 define makelib 48 define makelib
41 - ar cru $(2) $(1);  
42 - ranlib $(2);  
43 echo `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll 49 echo `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll
44 dlltool -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll) $(1); \ 50 dlltool -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll) $(1); \
45 $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll \ 51 $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll \