Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / openssl / makefile.mk
blob286e4242bb4276afdb91bf3b1794a9d918fe36db
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 #*************************************************************************
28 PRJ=.
30 PRJNAME=openssl
31 TARGET=openssl
33 # --- Settings -----------------------------------------------------
35 .INCLUDE : settings.mk
37 # --- Files --------------------------------------------------------
39 .IF "$(SYSTEM_OPENSSL)" == "YES"
40 @all:
41 @echo "Using system openssl...."
42 .ENDIF
44 .IF "$(DISABLE_OPENSSL)" == "TRUE"
45 @all:
46 @echo "openssl disabled...."
47 .ENDIF
49 OPENSSL_NAME=openssl-0.9.8v
51 TARFILE_NAME=$(OPENSSL_NAME)
52 TARFILE_MD5=51a40a81b3b7abe8a5c33670bd3da0ce
53 PATCH_FILES=openssl-asm-fix.patch
55 CONFIGURE_DIR=.
56 CONFIGURE_ACTION=config
57 .IF "$(OS)" == "ANDROID"
58 CONFIGURE_FLAGS=shared no-idea
59 .ELSE
60 # explicitly including /usr/include seems hyper-broken anyway but ...
61 CONFIGURE_FLAGS=-I$(SYSBASE)$/usr$/include -L$(SYSBASE)$/usr$/lib shared no-idea
62 .ENDIF
64 .IF "$(OS)" == "MACOSX"
65 CONFIGURE_FLAGS += \
66 --prefix=/@.__________________________________________________$(EXTRPATH)
67 .END
69 BUILD_DIR=.
71 COMPILER_AND_FLAGS=$(CC)
72 #See fdo#35404 If we're only interested in getting a .a (i.e. not windows) then
73 #force everything, when possible, as hidden symbols
74 .IF "$(OS)" != "WNT" && "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
75 COMPILER_AND_FLAGS+=-fvisibility=hidden
76 .ENDIF
78 BUILD_ACTION=make build_libs CC='$(COMPILER_AND_FLAGS)' -j1
80 OUT2LIB = libssl.*
81 OUT2LIB += libcrypto.*
82 OUT2INC += include/openssl/*
84 UNAME=$(shell uname)
86 .IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD" || "$(OS)" == "ANDROID"
87 PATCH_FILES+=openssllnx.patch
88 ADDITIONAL_FILES:= \
89 libcrypto_OOo_0_9_8v.map \
90 libssl_OOo_0_9_8v.map
91 .IF "$(CPU)" == "I"
92 .IF "$(UNAME)" == "GNU/kFreeBSD"
93 CONFIGURE_ACTION=Configure debian-kfreebsd-i386
94 .ELSE
95 CONFIGURE_ACTION=Configure linux-elf
96 .ENDIF
97 .ELIF "$(BUILD64)" == "1"
98 .IF "$(UNAME)" == "GNU/kFreeBSD"
99 CONFIGURE_ACTION=Configure debian-kfreebsd-amd64
100 .ELSE
101 CONFIGURE_ACTION=Configure linux-generic64
102 .ENDIF
103 .ELSE
104 CONFIGURE_ACTION=Configure linux-generic32
105 .ENDIF
106 # if you build openssl as shared library you have to patch the Makefile.Shared "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \"
107 #BUILD_ACTION=make 'SHARED_LDFLAGS=-Wl,--version-script=./lib$$(SHLIBDIRS)_OOo_0_9_8v.map'
108 .ENDIF
110 .IF "$(OS)" == "SOLARIS"
111 PATCH_FILES+=opensslsol.patch
112 ADDITIONAL_FILES:= \
113 libcrypto_OOo_0_9_8v.map \
114 libssl_OOo_0_9_8v.map
115 #BUILD_ACTION=make 'SHARED_LDFLAGS=-G -dy -z text -M./lib$$$$$$$$(SHLIBDIRS)_OOo_0_9_8v.map'
117 # Use BUILD64 when 1 to select new specific 64bit Configurations if necessary
119 .IF "$(CPUNAME)" == "INTEL" # Solaris INTEL
120 .IF "$(CPU)" == "X"
121 CONFIGURE_ACTION=Configure solaris64-x86_64-cc
122 .ELSE
123 CONFIGURE_ACTION=Configure solaris-x86-cc
124 .ENDIF
125 .ELIF "$(CPU)" == "U" # Solaris SPARC
126 CONFIGURE_ACTION=Configure solaris64-sparcv9-cc
127 .ELSE
128 CONFIGURE_ACTION=Configure solaris-sparcv9-cc
129 .ENDIF
130 .ENDIF
132 .IF "$(OS)" == "IOS"
133 PATCH_FILES+=opensslios.patch
134 CONFIGURE_ACTION=Configure ios-armv7
135 CONFIGURE_FLAGS=no-shared no-idea
136 .ENDIF
138 .IF "$(OS)" == "WNT"
140 .IF "$(COM)"=="GCC"
141 PATCH_FILES+=opensslmingw.patch
142 CONFIGURE_ACTION=$(PERL) Configure
143 CONFIGURE_FLAGS=mingw shared
144 INSTALL_ACTION=mv libcrypto.a libcrypto_static.a && mv libcrypto.dll.a libcrypto.a && mv libssl.a libssl_static.a && mv libssl.dll.a libssl.a
145 OUT2LIB = libcrypto_static.*
146 OUT2LIB += libssl_static.*
147 OUT2LIB += libcrypto.*
148 OUT2LIB += libssl.*
149 OUT2BIN = ssleay32.dll
150 OUT2BIN += libeay32.dll
151 .ELSE
153 PATCH_FILES+=openssl.patch
154 .IF "$(MAKETARGETS)" == ""
155 # The env. vars CC and PERL are used by nmake, and nmake insists on '\'s
156 # If WRAPCMD is set it is prepended before the compiler, don't touch that.
157 .IF "$(WRAPCMD)"==""
158 CC!:=$(subst,/,\ $(normpath,1 $(CC:1)))
159 CC!:=$(CC:s/ccache/ccache cl.exe/)
160 .EXPORT : CC
161 .ENDIF
162 PERL_bak:=$(PERL)
163 PERL!:=$(subst,/,\ $(normpath,1 $(PERL)))
164 .EXPORT : PERL
165 PERL!:=$(PERL_bak)
166 .ENDIF
168 #CONFIGURE_ACTION=cmd /c $(PERL:s!\!/!) configure
169 CONFIGURE_ACTION=$(PERL) configure
170 .IF "$(CPU)" == "I"
171 OPENSSL_PLATFORM=VC-WIN32
172 .ELSE
173 OPENSSL_PLATFORM=VC-WIN64A
174 .ENDIF
175 CONFIGURE_FLAGS=$(OPENSSL_PLATFORM) no-idea
176 BUILD_ACTION=cmd /c "ms$(EMQ)\do_ms.bat $(subst,/,\ $(normpath,1 $(PERL))) $(OPENSSL_PLATFORM)" && nmake -f ms/ntdll.mak
178 OUT2LIB = out32dll$/ssleay32.lib
179 OUT2LIB += out32dll$/libeay32.lib
180 OUT2BIN = out32dll$/ssleay32.dll
181 OUT2BIN += out32dll$/libeay32.dll
182 OUT2INC = inc32$/openssl$/*
183 .ENDIF
184 .ENDIF
186 #set INCLUDE=D:\sol_temp\n\msvc7net3\PlatformSDK\include;D:\sol_temp\n\msvc7net3\include\ && set path=%path%;D:\sol_temp\r\btw\SRC680\perl\bin &&
188 # --- Targets ------------------------------------------------------
190 .INCLUDE : set_ext.mk
191 .INCLUDE : target.mk
192 .INCLUDE : tg_ext.mk