xref: /aoo41x/main/openssl/makefile.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
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.
14#
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).
20#
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.
25#
26#*************************************************************************
27
28PRJ=.
29
30PRJNAME=openssl
31TARGET=openssl
32
33# --- Settings -----------------------------------------------------
34
35.INCLUDE :	settings.mk
36
37# --- Files --------------------------------------------------------
38
39.IF "$(SYSTEM_OPENSSL)" == "YES"
40@all:
41	@echo "Using system openssl...."
42.ENDIF
43
44.IF "$(DISABLE_OPENSSL)" == "TRUE"
45@all:
46	@echo "openssl disabled...."
47.ENDIF
48
49OPENSSL_NAME=openssl-0.9.8o
50
51TARFILE_NAME=$(OPENSSL_NAME)
52TARFILE_MD5=63ddc5116488985e820075e65fbe6aa4
53
54CONFIGURE_DIR=.
55CONFIGURE_ACTION=config
56CONFIGURE_FLAGS=-I$(SYSBASE)$/usr$/include -L$(SYSBASE)$/usr$/lib shared
57
58BUILD_DIR=.
59BUILD_ACTION=make CC='$(CC)'
60
61OUT2LIB = libssl.*
62OUT2LIB += libcrypto.*
63OUT2INC += include/openssl/*
64
65UNAME=$(shell uname)
66
67.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD"
68	PATCH_FILES=openssllnx.patch
69	ADDITIONAL_FILES:= \
70		libcrypto_OOo_0_9_8o.map \
71		libssl_OOo_0_9_8o.map
72	.IF "$(CPU)" == "I"
73		.IF "$(UNAME)" == "GNU/kFreeBSD"
74			CONFIGURE_ACTION=Configure debian-kfreebsd-i386
75		.ELSE
76			CONFIGURE_ACTION=Configure linux-elf
77		.ENDIF
78	.ELIF "$(BUILD64)" == "1"
79		.IF "$(UNAME)" == "GNU/kFreeBSD"
80			CONFIGURE_ACTION=Configure debian-kfreebsd-amd64
81		.ELSE
82			CONFIGURE_ACTION=Configure linux-generic64
83		.ENDIF
84	.ELSE
85		CONFIGURE_ACTION=Configure linux-generic32
86	.ENDIF
87	# if you build openssl as shared library you have to patch the Makefile.Shared "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \"
88	#BUILD_ACTION=make 'SHARED_LDFLAGS=-Wl,--version-script=./lib$$(SHLIBDIRS)_OOo_0_9_8e.map'
89.ENDIF
90
91.IF "$(OS)" == "SOLARIS"
92	PATCH_FILES=opensslsol.patch
93	ADDITIONAL_FILES:= \
94		libcrypto_OOo_0_9_8o.map \
95		libssl_OOo_0_9_8o.map
96	#BUILD_ACTION=make 'SHARED_LDFLAGS=-G -dy -z text -M./lib$$$$$$$$(SHLIBDIRS)_OOo_0_9_8e.map'
97
98	# Use BUILD64 when 1 to select new specific 64bit Configurations if necessary
99
100	.IF "$(CPUNAME)" == "INTEL" # Solaris INTEL
101		.IF "$(CPU)" == "X"
102		   CONFIGURE_ACTION=Configure solaris64-x86_64-cc
103		.ELSE
104		   CONFIGURE_ACTION=Configure solaris-x86-cc
105		.ENDIF
106	.ELIF "$(CPU)" == "U" # Solaris SPARC
107	   CONFIGURE_ACTION=Configure solaris64-sparcv9-cc
108	.ELSE
109	   CONFIGURE_ACTION=Configure solaris-sparcv9-cc
110	.ENDIF
111.ENDIF
112
113.IF "$(OS)" == "WNT"
114
115.IF "$(COM)"=="GCC"
116PATCH_FILES=opensslmingw.patch
117.IF "$(USE_MINGW)" == "cygwin"
118CONFIGURE_ACTION=$(PERL) configure
119CONFIGURE_FLAGS=mingw shared
120INSTALL_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
121OUT2LIB = libcrypto_static.*
122OUT2LIB += libssl_static.*
123OUT2LIB += libcrypto.*
124OUT2LIB += libssl.*
125OUT2BIN = ssleay32.dll
126OUT2BIN += libeay32.dll
127.ELSE
128CONFIGURE_ACTION=
129BUILD_ACTION=cmd /c "ms\mingw32"
130OUT2LIB = out/libcrypto_static.*
131OUT2LIB += out/libssl_static.*
132OUT2LIB += out/libcrypto.*
133OUT2LIB += out/libssl.*
134OUT2BIN = out/ssleay32.dll
135OUT2BIN += out/libeay32.dll
136.ENDIF
137.ELSE
138
139		PATCH_FILES=openssl.patch
140		.IF "$(MAKETARGETS)" == ""
141			# The env. vars CC and PERL are used by nmake, and nmake insists on '\'s
142			# If WRAPCMD is set it is prepended before the compiler, don't touch that.
143			.IF "$(WRAPCMD)"==""
144				CC!:=$(subst,/,\ $(normpath,1 $(CC)))
145				.EXPORT : CC
146			.ENDIF
147			PERL_bak:=$(PERL)
148			PERL!:=$(subst,/,\ $(normpath,1 $(PERL)))
149			.EXPORT : PERL
150			PERL!:=$(PERL_bak)
151		.ENDIF
152
153		#CONFIGURE_ACTION=cmd /c $(PERL:s!\!/!) configure
154		CONFIGURE_ACTION=$(PERL) configure
155		CONFIGURE_FLAGS=VC-WIN32
156		BUILD_ACTION=cmd /c "ms$(EMQ)\do_ms.bat $(subst,/,\ $(normpath,1 $(PERL)))" && nmake -f ms/ntdll.mak
157
158		OUT2LIB = out32dll$/ssleay32.lib
159		OUT2LIB += out32dll$/libeay32.lib
160		OUT2BIN = out32dll$/ssleay32.dll
161		OUT2BIN += out32dll$/libeay32.dll
162		OUT2INC = inc32$/openssl$/*
163	.ENDIF
164.ENDIF
165
166#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 &&
167
168# --- Targets ------------------------------------------------------
169
170.INCLUDE : set_ext.mk
171.INCLUDE : target.mk
172.INCLUDE : tg_ext.mk
173
174