update dev300-m58
[ooovba.git] / berkeleydb / makefile.mk
blobfd9f4d7f1b645d17ca35273691f59d72cb78a4c4
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
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)
114 .IF "$(OS)"=="IRIX"
115 CONFIGURE_ACTION= $(CONFIG_SHELL) ..$/dist$/configure
116 BUILD_ACTION=gmake
117 .ELSE
118 BUILD_ACTION=make
119 .ENDIF
121 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb*$(DLLPOST)
122 OUT2INC= \
123 $(BUILD_DIR)$/db.h
125 .ENDIF # "$(GUI)"=="UNX"
127 .IF "$(GUI)"=="WNT"
128 .IF "$(COM)"=="GCC"
129 CONFIGURE_DIR=out
130 #relative to CONFIGURE_DIR
131 # TODO needs clean up
132 CFLAGS+=-nostdinc -D_MT
133 db_CC=$(CC)
134 db_CXX=$(CXX)
135 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
136 db_CC+=-shared-libgcc
137 db_CXX+=-shared-libgcc
138 .ENDIF
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
142 .ENDIF
143 db_LDFLAGS+=-L$(COMPATH)/lib -L$(MINGW_CLIB_DIR)
144 db_LIBS=-lmingwthrd
145 .IF "$(MINGW_SHARED_GXXLIB)"=="YES"
146 db_LIBS+=-lstdc++_s
147 .ENDIF
148 db_LIBXSO_LIBS=$(LIBSTLPORT) $(db_LIBS)
149 .IF "$(MINGW_SHARED_GCCLIB)"=="YES"
150 db_LIBXSO_LIBS+=-lgcc_s
151 .ENDIF
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)
157 BUILD_ACTION=make
159 OUT2LIB=$(BUILD_DIR)$/.libs$/libdb47.dll.a
160 OUT2BIN=$(BUILD_DIR)$/.libs$/libdb47.dll
162 OUT2INC= \
163 $(BUILD_DIR)$/db.h
164 .IF "$(GUI)$(COM)"=="WNTGCC"
165 .EXPORT : PWD
166 .ENDIF
168 .ELSE
169 # make use of stlport headerfiles
170 EXT_USE_STLPORT=TRUE
172 .IF "$(USE_SHELL)"!="4nt"
173 BUILD_ACTION_SEP=;
174 .ELSE # "$(USE_SHELL)"!="4nt"
175 BUILD_ACTION_SEP=^
176 .ENDIF # "$(USE_SHELL)"!="4nt"
177 BUILD_DIR=
178 BUILD_ACTION=dmake
180 BUILD_DIR_OUT=build_windows
181 #OUT2LIB= \
182 # $(BUILD_DIR_OUT)$/Release$/libdb42.lib
183 #OUT2BIN=$(BUILD_DIR_OUT)$/Release$/libdb42.dll
184 OUT2INC= \
185 $(BUILD_DIR_OUT)$/db.h
186 .ENDIF
187 .ENDIF # "$(GUI)"=="WNT"
189 # --- Targets ------------------------------------------------------
191 .INCLUDE : set_ext.mk
192 .INCLUDE : target.mk
193 .INCLUDE : tg_ext.mk