Commit 7398ef88b78d04b1428ed6336325a89f55117841
1 parent
6e193e31
further refinements to build
git-svn-id: svn+q:///qpdf/trunk@759 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing
6 changed files
with
39 additions
and
18 deletions
Makefile
README.windows
| ... | ... | @@ -10,3 +10,8 @@ Must add libqpdf/build to PATH. |
| 10 | 10 | To debug a crash in MSVC's debugger, start an instance of Visual C++. |
| 11 | 11 | When the abort/retry/ignore dialog pops up, first attach the process |
| 12 | 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
make/gcc-linux.mk
| ... | ... | @@ -5,7 +5,7 @@ LOBJ=o |
| 5 | 5 | |
| 6 | 6 | # Usage: $(call libname,base) |
| 7 | 7 | define libname |
| 8 | -lib$(1).a lib$(1).so | |
| 8 | +lib$(1).so | |
| 9 | 9 | endef |
| 10 | 10 | |
| 11 | 11 | # Usage: $(call binname,base) |
| ... | ... | @@ -41,22 +41,25 @@ define libcompile |
| 41 | 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 | 52 | # 1 2 3 4 5 |
| 45 | 53 | # Usage: $(call makelib,objs,library,current,revision,age) |
| 46 | 54 | define makelib |
| 47 | 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 | 63 | endef |
| 61 | 64 | |
| 62 | 65 | # 1 2 | ... | ... |
make/libtool.mk
| ... | ... | @@ -57,6 +57,14 @@ define libcompile |
| 57 | 57 | $(call fixdeps,$(basename $(call src_to_obj,$(1)))) |
| 58 | 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 | 68 | # 1 2 3 4 5 |
| 61 | 69 | # Usage: $(call makelib,objs,library,current,revision,age) |
| 62 | 70 | define makelib | ... | ... |
make/mingw.mk
| ... | ... | @@ -35,11 +35,17 @@ endef |
| 35 | 35 | |
| 36 | 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 | 46 | # 1 2 3 4 5 |
| 39 | 47 | # Usage: $(call makelib,objs,library,current,revision,age) |
| 40 | 48 | define makelib |
| 41 | - ar cru $(2) $(1); | |
| 42 | - ranlib $(2); | |
| 43 | 49 | echo `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll |
| 44 | 50 | dlltool -l $(2) -D $$(basename `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll) $(1); \ |
| 45 | 51 | $(CXX) -shared -o `echo $(2) | sed -e 's,/lib\(.*\).a,/\1,'`$(3).dll \ | ... | ... |