1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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 #*************************************************************************
33 # --- Settings -----------------------------------------------------
35 .INCLUDE
: settings.mk
37 .IF
"$(SYSTEM_DB)" == "YES"
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."
43 # --- Files --------------------------------------------------------
45 TARFILE_NAME
=db-4.7
.25.NC-custom
46 TARFILE_MD5
=d70951c80dabecc2892c919ff5d07172
47 TARFILE_ROOTDIR
=db-4.7
.25.NC
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 \
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"
76 # clean compiler flags
80 # disable aliasing for all GCC platforms, at least GCC 4.x needs it if
81 # optimization level >= 2
83 CFLAGS
:=-fno-strict-aliasing
$(EXTRA_CFLAGS
)
84 CXXFLAGS
:=-fno-strict-aliasing
$(EXTRA_CFLAGS
)
85 .IF
"$(ENABLE_SYMBOLS)"!=""
92 .IF
"$(OS)$(COM)"=="LINUXGCC"
93 LDFLAGS
:=-Wl
,-rpath
,'$$$$ORIGIN'
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'\'
103 .ENDIF
# "$(OS)$(COM)"=="SOLARISC52"
106 #relative to CONFIGURE_DIR
109 CONFIGURE_FLAGS
=--disable-cxx
--enable-dynamic
--enable-compat185 CC
='$(CC) $(SOLARLIB)'
111 CONFIGURE_FLAGS
+= --disable-shared
113 CONFIGURE_FLAGS
+= --enable-shared
115 .IF
"$(OS)"=="MACOSX"
117 --prefix=/@.__________________________________________________
$(EXTRPATH
) \
118 CPPFLAGS
="$(EXTRA_CDEFS)"
120 .IF
"$(CROSS_COMPILING)"=="YES"
121 CONFIGURE_FLAGS
+=--build
=$(BUILD_PLATFORM
) --host
=$(HOST_PLATFORM
)
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
)
134 OUT2LIB
=$(BUILD_DIR
)$/libdb
*.a
136 OUT2LIB
=$(BUILD_DIR
)$/.libs
$/libdb
*$(DLLPOST
)
141 .ENDIF
# "$(GUI)"=="UNX"
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
154 db_LDFLAGS
=-L
$(SOLARVER
)/$(INPATH
)/lib
-L
$(SOLARVER
)/$(INPATH
)/bin
155 db_LDFLAGS
+=-L
$(COMPATH
)/lib
-L
$(MINGW_CLIB_DIR
)
157 .IF
"$(MINGW_SHARED_GXXLIB)"=="YES"
158 CFLAGS
+=-D_GLIBCXX_DLL
159 db_LIBS
+=$(MINGW_SHARED_LIBSTDCPP
)
161 db_LIBXSO_LIBS
=$(db_LIBS
)
162 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
163 db_LIBXSO_LIBS
+=-lgcc_s
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
)
172 OUT2LIB
=$(BUILD_DIR
)$/.libs
$/libdb47.dll.a
173 OUT2BIN
=$(BUILD_DIR
)$/.libs
$/libdb47.dll
177 .IF
"$(GUI)$(COM)"=="WNTGCC"
185 BUILD_DIR_OUT
=build_windows
187 $(BUILD_DIR_OUT
)$/db.h
189 .ENDIF
# "$(GUI)"=="WNT"
191 # --- Targets ------------------------------------------------------
193 .INCLUDE
: set_ext.mk