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.2
.52.NC-custom
50 TARFILE_ROOTDIR
=db-4.2
.52.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 db_printlog
$/makefile.mk env
$/makefile.mk fileops
$/makefile.mk hash
$/makefile.mk \
56 hmac
$/makefile.mk hsearch
$/makefile.mk lock
$/makefile.mk \
57 log
$/makefile.mk mp
$/makefile.mk mutex
$/makefile.mk os
$/makefile.mk \
58 os_win32
$/makefile.mk qam
$/makefile.mk rep
$/makefile.mk txn
$/makefile.mk \
59 xa
$/makefile.mk libdb42.dxp db_4_2_gcc3.map
63 # not needed for win32. comment out when causing problems...
64 .IF
"$(GUI)$(COM)"=="WNTGCC"
65 PATCH_FILE_NAME
=db-4.2
.52-mingw.patch
67 PATCH_FILE_NAME
=db-4.2
.52.patch
70 # clean compiler flags
74 # disable aliasing for all GCC platforms, at least GCC 4.x needs it if
75 # optimization level >= 2
77 CFLAGS
:=-fno-strict-aliasing
$(EXTRA_CFLAGS
)
78 CXXFLAGS
:=-fno-strict-aliasing
$(EXTRA_CFLAGS
)
82 .IF
"$(OS)$(COM)"=="LINUXGCC"
83 LDFLAGS
:=-Wl
,-rpath
,'$$$$ORIGIN' -Wl
,-z
,noexecstack
85 #The current dir when linking is unxlngi6.pro/misc/build/db-4.2.52.NC/out
86 # the map file is in unxlngi6.pro/misc/build/db-4.2.52.NC
87 LDFLAGSVERSION
:= -Wl
,--version-script
=..
/db_4_2_gcc3.map
88 .EXPORT
: LDFLAGSVERSION
89 .ENDIF
# "$(OS)$(COM)"=="LINUXGCC"
90 .IF
"$(OS)$(COM)"=="SOLARISC52"
91 #.IF "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
92 #CC:=$(COMPATH)$/bin$/cc
93 #CXX:=$(COMPATH)$/bin$/CC
94 #.ENDIF # "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
95 LDFLAGS
:=$(ARCH_FLAGS
) -R
\''$$$$ORIGIN'\'
97 .ENDIF
# "$(OS)$(COM)"=="SOLARISC52"
99 #relative to CONFIGURE_DIR
102 CONFIGURE_FLAGS
=--disable-cxx
--enable-dynamic
--enable-shared
--enable-compat185
104 # just pass ARCH_FLAGS to native build
105 CFLAGS
+:=$(ARCH_FLAGS
)
106 CXXFLAGS
+:=$(ARCH_FLAGS
)
107 .EXPORT
: CFLAGS CXXFLAGS
109 BUILD_DIR
=$(CONFIGURE_DIR
)
110 BUILD_DIR_OUT
=$(CONFIGURE_DIR
)
112 CONFIGURE_ACTION
= $(CONFIG_SHELL
) ..
$/dist$/configure
118 OUT2LIB
=$(BUILD_DIR
)$/.libs
$/libdb
*$(DLLPOST
)
122 .ENDIF
# "$(GUI)"=="UNX"
127 #relative to CONFIGURE_DIR
128 # TODO needs clean up
129 CFLAGS
+=-nostdinc
-D_MT
130 CONFIGURE_ACTION
=..
$/dist$/configure
131 CONFIGURE_FLAGS
=--enable-cxx
--enable-dynamic
--enable-shared
--build
=i586-pc-mingw32
--host
=i586-pc-mingw32
--enable-mingw LN_S
=ln NM
="$(WRAPCMD) nm" OBJDUMP
="$(WRAPCMD) objdump" JAVA
="$(WRAPCMD) -env java" JAVAC
="$(WRAPCMD) -env javac" CFLAGS
="$(CFLAGS)" CPPFLAGS
="$(INCLUDE)" LIBS
="-lmingwthrd" LIBSO_LIBS
="-lmingwthrd" LIBJSO_LIBS
="-lmingwthrd" LIBXSO_LIBS
="-lmingwthrd $(LIBSTLPORT)"
132 .IF
"$(USE_MINGW)"=="cygwin"
133 CONFIGURE_FLAGS
+=LDFLAGS
="-no-undefined -L$(SOLARVER)/$(INPATH)/lib -L$(SOLARVER)/$(INPATH)/bin -L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api -L$(COMPATH)/lib"
135 CONFIGURE_FLAGS
+=LDFLAGS
="-no-undefined -L$(SOLARVER)/$(INPATH)/lib -L$(SOLARVER)/$(INPATH)/bin -L$(COMPATH)/lib"
138 BUILD_DIR
=$(CONFIGURE_DIR
)
139 BUILD_DIR_OUT
=$(CONFIGURE_DIR
)
142 OUT2LIB
=$(BUILD_DIR
)$/.libs
$/libdb
*42.a
143 OUT2BIN
=$(BUILD_DIR
)$/.libs
$/libdb
*42.dll
147 .IF
"$(GUI)$(COM)"=="WNTGCC"
152 # make use of stlport headerfiles
155 .IF
"$(USE_SHELL)"!="4nt"
157 .ELSE
# "$(USE_SHELL)"!="4nt"
159 .ENDIF
# "$(USE_SHELL)"!="4nt"
163 BUILD_DIR_OUT
=build_win32
165 # $(BUILD_DIR_OUT)$/Release$/libdb42.lib
166 #OUT2BIN=$(BUILD_DIR_OUT)$/Release$/libdb42.dll
168 $(BUILD_DIR_OUT
)$/db.h
170 .ENDIF
# "$(GUI)"=="WNT"
172 # --- Targets ------------------------------------------------------
174 .INCLUDE
: set_ext.mk