merge the formfield patch from ooo-build
[ooovba.git] / berkeleydb / makefile.mk
blob7ee3beb1b07d6fcc5d14ec39e661e9d30748ac70
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
11 # $Revision: 1.48 $
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 #*************************************************************************
32 PRJ=.
34 PRJNAME=so_berkeleydb
35 TARGET=so_berkeleydb
37 # --- Settings -----------------------------------------------------
39 .INCLUDE : settings.mk
41 .IF "$(SYSTEM_DB)" == "YES"
42 all:
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."
45 .ENDIF
47 # --- Files --------------------------------------------------------
49 TARFILE_NAME=db-4.7.25.NC-custom
50 TARFILE_ROOTDIR=db-4.7.25.NC
52 ADDITIONAL_FILES= \
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 \
60 db_4_7_gcc4.map
64 # not needed for win32. comment out when causing problems...
65 .IF "$(GUI)$(COM)"=="WNTGCC"
66 PATCH_FILES=db-4.7.25-mingw.patch
67 .ELSE
68 PATCH_FILES=db-4.7.25.patch
69 .ENDIF
71 # clean compiler flags
72 CFLAGS:=
73 CXXFLAGS:=
75 # disable aliasing for all GCC platforms, at least GCC 4.x needs it if
76 # optimization level >= 2
77 .IF "$(COM)"=="GCC"
78 CFLAGS:=-fno-strict-aliasing $(EXTRA_CFLAGS)
79 CXXFLAGS:=-fno-strict-aliasing $(EXTRA_CFLAGS)
80 .ENDIF
82 .IF "$(GUI)"=="UNX"
83 .IF "$(OS)$(COM)"=="LINUXGCC"
84 LDFLAGS:=-Wl,-rpath,'$$$$ORIGIN' -Wl,-z,noexecstack
85 .EXPORT: LDFLAGS
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'\'
97 .EXPORT: LDFLAGS
98 .ENDIF # "$(OS)$(COM)"=="SOLARISC52"
100 CONFIGURE_DIR=out
101 #relative to CONFIGURE_DIR
102 CONFIGURE_ACTION= \
103 ..$/dist$/configure
104 CONFIGURE_FLAGS=--disable-cxx --enable-dynamic --enable-shared --enable-compat185
105 .IF "$(OS)"=="MACOSX"
106 CONFIGURE_FLAGS+=CPPFLAGS="$(EXTRA_CDEFS)"
107 .ENDIF
108 # just pass ARCH_FLAGS to native build
109 CFLAGS+:=$(ARCH_FLAGS)
110 CXXFLAGS+:=$(ARCH_FLAGS)
111 .EXPORT : CFLAGS CXXFLAGS
113 BUILD_DIR=$(CONFIGURE_DIR)
114 BUILD_DIR_OUT=$(CONFIGURE_DIR)
116 .IF "$(OS)"=="IRIX"
117 CONFIGURE_ACTION= $(CONFIG_SHELL) ..$/dist$/configure
118 BUILD_ACTION=gmake
119 .ELSE
120 BUILD_ACTION=make
121 .ENDIF
123 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb*$(DLLPOST)
124 OUT2INC= \
125 $(BUILD_DIR)$/db.h
127 .ENDIF # "$(GUI)"=="UNX"
129 .IF "$(GUI)"=="WNT"
130 .IF "$(COM)"=="GCC"
131 CONFIGURE_DIR=out
132 #relative to CONFIGURE_DIR
133 # TODO needs clean up
134 CFLAGS+=-nostdinc -D_MT
135 db_CC=$(CC)
136 db_CXX=$(CXX)
137 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
138 db_CC+=-shared-libgcc
139 db_CXX+=-shared-libgcc
140 .ENDIF
141 db_LDFLAGS=-no-undefined -L$(SOLARVER)/$(INPATH)/lib -L$(SOLARVER)/$(INPATH)/bin
142 .IF "$(USE_MINGW)"=="cygwin"
143 db_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api
144 .ENDIF
145 db_LDFLAGS+=-L$(COMPATH)/lib -L$(MINGW_CLIB_DIR)
146 db_LIBS=-lmingwthrd
147 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
148 CFLAGS+=-D_GLIBCXX_DLL
149 db_LIBS+=-lstdc++_s
150 .ENDIF
151 db_LIBXSO_LIBS=$(LIBSTLPORT) $(db_LIBS)
152 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
153 db_LIBXSO_LIBS+=-lgcc_s
154 .ENDIF
155 CONFIGURE_ACTION=..$/dist$/configure
156 CONFIGURE_FLAGS=--disable-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)"
158 BUILD_DIR=$(CONFIGURE_DIR)
159 BUILD_DIR_OUT=$(CONFIGURE_DIR)
160 BUILD_ACTION=make
162 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb47.dll.a
163 OUT2BIN=$(BUILD_DIR)$/.libs$/libdb47.dll
165 OUT2INC= \
166 $(BUILD_DIR)$/db.h
167 .IF "$(GUI)$(COM)"=="WNTGCC"
168 .EXPORT : PWD
169 .ENDIF
171 .ELSE
172 # make use of stlport headerfiles
173 EXT_USE_STLPORT=TRUE
175 .IF "$(USE_SHELL)"!="4nt"
176 BUILD_ACTION_SEP=;
177 .ELSE # "$(USE_SHELL)"!="4nt"
178 BUILD_ACTION_SEP=^
179 .ENDIF # "$(USE_SHELL)"!="4nt"
180 BUILD_DIR=
181 BUILD_ACTION=dmake
183 BUILD_DIR_OUT=build_windows
184 #OUT2LIB= \
185 # $(BUILD_DIR_OUT)$/Release$/libdb42.lib
186 #OUT2BIN=$(BUILD_DIR_OUT)$/Release$/libdb42.dll
187 OUT2INC= \
188 $(BUILD_DIR_OUT)$/db.h
189 .ENDIF
190 .ENDIF # "$(GUI)"=="WNT"
192 # --- Targets ------------------------------------------------------
194 .INCLUDE : set_ext.mk
195 .INCLUDE : target.mk
196 .INCLUDE : tg_ext.mk