1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
37 # --- Settings -----------------------------------------------------
39 .INCLUDE
: settings.mk
41 .IF
"$(SYSTEM_DB)" == "YES"
43 @echo
"An already available installation of db should exist on your system."
44 @echo
"Therefore the version provided here does not need to be built in addition."
47 # --- Files --------------------------------------------------------
49 TARFILE_NAME
=db-4.7
.25.NC-custom
50 TARFILE_ROOTDIR
=db-4.7
.25.NC
53 makefile.mk btree
$/makefile.mk clib
$/makefile.mk common
$/makefile.mk \
54 cxx$/makefile.mk db
$/makefile.mk dbm
$/makefile.mk dbreg
$/makefile.mk \
55 env
$/makefile.mk fileops
$/makefile.mk hash
$/makefile.mk hmac
$/makefile.mk \
56 hsearch
$/makefile.mk lock
$/makefile.mk log
$/makefile.mk mp
$/makefile.mk \
57 mutex
$/makefile.mk os
$/makefile.mk os_windows
$/makefile.mk \
58 qam
$/makefile.mk rep
$/makefile.mk repmgr
$/makefile.mk \
59 sequence
$/makefile.mk txn
$/makefile.mk xa
$/makefile.mk \
64 # not needed for win32. comment out when causing problems...
65 .IF
"$(GUI)$(COM)"=="WNTGCC"
66 PATCH_FILES
=db-4.7
.25-mingw.patch
68 PATCH_FILES
=db-4.7
.25.patch
71 # clean compiler flags
75 # disable aliasing for all GCC platforms, at least GCC 4.x needs it if
76 # optimization level >= 2
78 CFLAGS
:=-fno-strict-aliasing
$(EXTRA_CFLAGS
)
79 CXXFLAGS
:=-fno-strict-aliasing
$(EXTRA_CFLAGS
)
83 .IF
"$(OS)$(COM)"=="LINUXGCC"
84 LDFLAGS
:=-Wl
,-rpath
,'$$$$ORIGIN' -Wl
,-z
,noexecstack
86 #The current dir when linking is unxlngi6.pro/misc/build/db-4.2.52.NC/out
87 # the map file is in unxlngi6.pro/misc/build/db-4.2.52.NC
88 LDFLAGSVERSION
:= -Wl
,--version-script
=..
/db_4_7_gcc4.map
89 .EXPORT
: LDFLAGSVERSION
90 .ENDIF
# "$(OS)$(COM)"=="LINUXGCC"
91 .IF
"$(OS)$(COM)"=="SOLARISC52"
92 #.IF "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
93 #CC:=$(COMPATH)$/bin$/cc
94 #CXX:=$(COMPATH)$/bin$/CC
95 #.ENDIF # "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
96 LDFLAGS
:=$(ARCH_FLAGS
) -R
\''$$$$ORIGIN'\'
98 .ENDIF
# "$(OS)$(COM)"=="SOLARISC52"
101 #relative to CONFIGURE_DIR
104 CONFIGURE_FLAGS
=--disable-cxx
--enable-dynamic
--enable-shared
--enable-compat185
106 # just pass ARCH_FLAGS to native build
107 CFLAGS
+:=$(ARCH_FLAGS
)
108 CXXFLAGS
+:=$(ARCH_FLAGS
)
109 .EXPORT
: CFLAGS CXXFLAGS
111 BUILD_DIR
=$(CONFIGURE_DIR
)
112 BUILD_DIR_OUT
=$(CONFIGURE_DIR
)
115 CONFIGURE_ACTION
= $(CONFIG_SHELL
) ..
$/dist$/configure
121 OUT2LIB
=$(BUILD_DIR
)$/.libs
$/libdb
*$(DLLPOST
)
125 .ENDIF
# "$(GUI)"=="UNX"
130 #relative to CONFIGURE_DIR
131 # TODO needs clean up
132 CFLAGS
+=-nostdinc
-D_MT
135 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
136 db_CC
+=-shared-libgcc
137 db_CXX
+=-shared-libgcc
139 db_LDFLAGS
=-no-undefined
-L
$(SOLARVER
)/$(INPATH
)/lib
-L
$(SOLARVER
)/$(INPATH
)/bin
140 .IF
"$(USE_MINGW)"=="cygwin"
141 db_LDFLAGS
+=-L
$(COMPATH
)/lib
/mingw
-L
$(COMPATH
)/lib
/w32api
143 db_LDFLAGS
+=-L
$(COMPATH
)/lib
-L
$(MINGW_CLIB_DIR
)
145 .IF
"$(MINGW_SHARED_GXXLIB)"=="YES"
148 db_LIBXSO_LIBS
=$(LIBSTLPORT
) $(db_LIBS
)
149 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
150 db_LIBXSO_LIBS
+=-lgcc_s
152 CONFIGURE_ACTION
=..
$/dist$/configure
153 CONFIGURE_FLAGS
=--enable-cxx
--enable-dynamic
--enable-shared
--build
=i586-pc-mingw32
--host
=i586-pc-mingw32
--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)"
155 BUILD_DIR
=$(CONFIGURE_DIR
)
156 BUILD_DIR_OUT
=$(CONFIGURE_DIR
)
159 OUT2LIB
=$(BUILD_DIR
)$/.libs
$/libdb47.dll.a
160 OUT2BIN
=$(BUILD_DIR
)$/.libs
$/libdb47.dll
164 .IF
"$(GUI)$(COM)"=="WNTGCC"
169 # make use of stlport headerfiles
172 .IF
"$(USE_SHELL)"!="4nt"
174 .ELSE
# "$(USE_SHELL)"!="4nt"
176 .ENDIF
# "$(USE_SHELL)"!="4nt"
180 BUILD_DIR_OUT
=build_windows
182 # $(BUILD_DIR_OUT)$/Release$/libdb42.lib
183 #OUT2BIN=$(BUILD_DIR_OUT)$/Release$/libdb42.dll
185 $(BUILD_DIR_OUT
)$/db.h
187 .ENDIF
# "$(GUI)"=="WNT"
189 # --- Targets ------------------------------------------------------
191 .INCLUDE
: set_ext.mk