Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / berkeleydb / makefile.mk
blob6ee001dd7c6460986fdba28467ae8f63fa8cd926
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 PRJ=.
30 PRJNAME=so_berkeleydb
31 TARGET=so_berkeleydb
33 # --- Settings -----------------------------------------------------
35 .INCLUDE : settings.mk
37 .IF "$(SYSTEM_DB)" == "YES"
38 all:
39 @echo "An already available installation of db should exist on your system."
40 @echo "Therefore the version provided here does not need to be built in addition."
41 .ENDIF
43 # --- Files --------------------------------------------------------
45 TARFILE_NAME=db-4.7.25.NC-custom
46 TARFILE_MD5=d70951c80dabecc2892c919ff5d07172
47 TARFILE_ROOTDIR=db-4.7.25.NC
49 ADDITIONAL_FILES= \
50 makefile.mk btree$/makefile.mk clib$/makefile.mk common$/makefile.mk \
51 cxx$/makefile.mk db$/makefile.mk dbm$/makefile.mk dbreg$/makefile.mk \
52 env$/makefile.mk fileops$/makefile.mk hash$/makefile.mk hmac$/makefile.mk \
53 hsearch$/makefile.mk lock$/makefile.mk log$/makefile.mk mp$/makefile.mk \
54 mutex$/makefile.mk os$/makefile.mk os_windows$/makefile.mk \
55 qam$/makefile.mk rep$/makefile.mk repmgr$/makefile.mk \
56 sequence$/makefile.mk txn$/makefile.mk xa$/makefile.mk \
57 db_4_7_gcc4.map
59 # not needed for win32. comment out when causing problems...
60 .IF "$(GUI)$(COM)"=="WNTGCC"
61 PATCH_FILES=db-4.7.25-mingw.patch
62 PATCH_FILES += db-4.7.25.NC-mingw32hack.patch
63 # otherwise, db-4.7.25.NC/dist/configure decides for _FILE_OFFSET_BITS=64,
64 # which causes /usr/i686-w64-mingw32/sys-root/mingw/include/_mingw.h to not
65 # define _USE_32BIT_TIME_T, so that berkeleydb uses a 64 bit time_t while
66 # the rest of LibreOffice uses a 32 bit time_t, which causes problems as
67 # there is e.g. a member time_t timestamp of struct __db in db.h; see
68 # <http://sourceforge.net/support/tracker.php?aid=3513251> "_mingw.h: size
69 # of time_t depends on _FILE_OFFSET_BITS"
70 .ELSE
71 PATCH_FILES=\
72 db-4.7.25.patch \
73 db-aix.patch
74 .ENDIF
76 # clean compiler flags
77 CFLAGS:=
78 CXXFLAGS:=
80 # disable aliasing for all GCC platforms, at least GCC 4.x needs it if
81 # optimization level >= 2
82 .IF "$(COM)"=="GCC"
83 CFLAGS:=-fno-strict-aliasing $(EXTRA_CFLAGS)
84 CXXFLAGS:=-fno-strict-aliasing $(EXTRA_CFLAGS)
85 .IF "$(ENABLE_SYMBOLS)"!=""
86 CFLAGS+=-g
87 CXXFLAGS+=-g
88 .ENDIF
89 .ENDIF
91 .IF "$(GUI)"=="UNX"
92 .IF "$(OS)$(COM)"=="LINUXGCC"
93 LDFLAGS:=-Wl,-rpath,'$$$$ORIGIN'
94 .EXPORT: LDFLAGS
95 #The current dir when linking is unxlngi6.pro/misc/build/db-4.2.52.NC/out
96 # the map file is in unxlngi6.pro/misc/build/db-4.2.52.NC
97 LDFLAGSVERSION:= -Wl,--version-script=../db_4_7_gcc4.map
98 .EXPORT: LDFLAGSVERSION
99 .ENDIF # "$(OS)$(COM)"=="LINUXGCC"
100 .IF "$(OS)$(COM)"=="SOLARISC52"
101 LDFLAGS:=$(ARCH_FLAGS) -R\''$$$$ORIGIN'\'
102 .EXPORT: LDFLAGS
103 .ENDIF # "$(OS)$(COM)"=="SOLARISC52"
105 CONFIGURE_DIR=out
106 #relative to CONFIGURE_DIR
107 CONFIGURE_ACTION= \
108 ..$/dist$/configure
109 CONFIGURE_FLAGS=--disable-cxx --enable-dynamic --enable-compat185 CC='$(CC) $(SOLARLIB)'
110 .IF "$(OS)"=="IOS"
111 CONFIGURE_FLAGS+= --disable-shared
112 .ELSE
113 CONFIGURE_FLAGS+= --enable-shared
114 .ENDIF
115 .IF "$(OS)"=="MACOSX"
116 CONFIGURE_FLAGS += \
117 --prefix=/@.__________________________________________________$(EXTRPATH) \
118 CPPFLAGS="$(EXTRA_CDEFS)"
119 .ENDIF
120 .IF "$(CROSS_COMPILING)"=="YES"
121 CONFIGURE_FLAGS+=--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
122 .ENDIF
124 # just pass ARCH_FLAGS to native build
125 CFLAGS+:=$(ARCH_FLAGS)
126 CXXFLAGS+:=$(ARCH_FLAGS)
127 .EXPORT : CFLAGS CXXFLAGS
129 BUILD_DIR=$(CONFIGURE_DIR)
130 BUILD_DIR_OUT=$(CONFIGURE_DIR)
131 BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
133 .IF "$(OS)"=="IOS"
134 OUT2LIB=$(BUILD_DIR)$/libdb*.a
135 .ELSE
136 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb*$(DLLPOST)
137 .ENDIF
138 OUT2INC= \
139 $(BUILD_DIR)$/db.h
141 .ENDIF # "$(GUI)"=="UNX"
143 .IF "$(GUI)"=="WNT"
144 .IF "$(COM)"=="GCC"
145 CONFIGURE_DIR=out
146 #relative to CONFIGURE_DIR
147 # TODO needs clean up
148 db_CC=$(CC) -mthreads
149 db_CXX=$(CXX) -mthreads
150 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
151 db_CC+=-shared-libgcc
152 db_CXX+=-shared-libgcc
153 .ENDIF
154 db_LDFLAGS=-L$(SOLARVER)/$(INPATH)/lib -L$(SOLARVER)/$(INPATH)/bin
155 db_LDFLAGS+=-L$(COMPATH)/lib -L$(MINGW_CLIB_DIR)
156 db_LIBS=
157 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
158 CFLAGS+=-D_GLIBCXX_DLL
159 db_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
160 .ENDIF
161 db_LIBXSO_LIBS=$(db_LIBS)
162 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
163 db_LIBXSO_LIBS+=-lgcc_s
164 .ENDIF
165 CONFIGURE_ACTION=..$/dist$/configure
166 CONFIGURE_FLAGS=--disable-cxx --enable-dynamic --enable-shared --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --enable-mingw CC="$(db_CC)" CXX="$(db_CXX)" LN_S=ln NM="$(WRAPCMD) nm" OBJDUMP="$(WRAPCMD) objdump" JAVA="$(WRAPCMD) -env java" JAVAC="$(WRAPCMD) -env javac" CFLAGS="$(CFLAGS)" CPPFLAGS="$(INCLUDE)" LDFLAGS="$(db_LDFLAGS)" LIBS="$(db_LIBS)" LIBSO_LIBS="$(db_LIBS)" LIBJSO_LIBS="$(db_LIBS)" LIBXSO_LIBS="$(db_LIBXSO_LIBS)"
168 BUILD_DIR=$(CONFIGURE_DIR)
169 BUILD_DIR_OUT=$(CONFIGURE_DIR)
170 BUILD_ACTION=make
172 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb47.dll.a
173 OUT2BIN=$(BUILD_DIR)$/.libs$/libdb47.dll
175 OUT2INC= \
176 $(BUILD_DIR)$/db.h
177 .IF "$(GUI)$(COM)"=="WNTGCC"
178 .EXPORT : PWD
179 .ENDIF
181 .ELSE
182 BUILD_DIR=
183 BUILD_ACTION=dmake
185 BUILD_DIR_OUT=build_windows
186 OUT2INC= \
187 $(BUILD_DIR_OUT)$/db.h
188 .ENDIF
189 .ENDIF # "$(GUI)"=="WNT"
191 # --- Targets ------------------------------------------------------
193 .INCLUDE : set_ext.mk
194 .INCLUDE : target.mk
195 .INCLUDE : tg_ext.mk