xref: /aoo41x/ext_libraries/serf/makefile.mk (revision 64f932e6)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22PRJ=.
23
24PRJNAME=serf
25TARGET=so_serf
26
27# --- Settings -----------------------------------------------------
28
29.INCLUDE :	settings.mk
30.INCLUDE :	serf_version.mk
31
32# --- Files --------------------------------------------------------
33
34.IF "$(SYSTEM_SERF)"=="YES"
35
36all:
37	@echo "Using system serf.  Does not have to be built."
38
39.ELSE
40
41# Assemble the full version number from the parts defined in serf_version.mk
42LIBSERFVERSION=$(SERF_MAJOR).$(SERF_MINOR).$(SERF_MICRO)
43
44TARFILE_NAME=$(PRJNAME)-$(LIBSERFVERSION)
45# This is the SHA1 checksum, not MD5 but tg_ext.mk does not now about this and,
46# thankfully, does not care.
47TARFILE_MD5=f65fbbd72926c8e7cf0dbd4ada03b0d226f461fd
48
49PATCH_FILES=
50
51.IF "$(OS)"=="WNT"
52
53CONFIGURE_DIR=
54CONFIGURE_ACTION=
55CONFIGURE_FLAGS=
56
57BUILD_DIR=
58BUILD_ACTION=$(GNUMAKE)
59BUILD_FLAGS+= -f ../../../../win/Makefile -j$(EXTMAXPROCESS)
60
61.ELIF "$(GUI)" == "OS2"
62
63@all:
64	@echo "using system serf. nothing do do."
65
66.ELSE
67
68.IF "$(OS)"=="MACOSX" || "$(OS)"=="FREEBSD" || "$(OS)"=="LINUX"
69# Do not link against expat.  It is not necessary (apr-util is already linked against it)
70# and does not work (we use a different expat library schema.)
71PATCH_FILES+=$(TARFILE_NAME).libs.patch
72.ENDIF
73
74.IF "$(OS)"=="LINUX"
75# Add -ldl as last library so that the linker has no trouble resolving dependencies.
76PATCH_FILES+=$(TARFILE_NAME).ldl.patch
77.ENDIF
78
79# Export ENABLE_SERF_LOGGING=YES to enable serf logging
80.IF "$(ENABLE_SERF_LOGGING)" == "YES"
81PATCH_FILES+=$(TARFILE_NAME).logging.patch
82CDEFS+=-DENABLE_SERF_VERBOSE -DSERF_VERBOSE
83.ENDIF
84
85CONFIGURE_DIR=
86CONFIGURE_ACTION=autoconf && .$/configure
87
88.IF "$(OS)"=="LINUX"
89.IF "$(SYSTEM_OPENSSL)"=="YES"
90CDEFS+=$(OPENSSL_CFLAGS)
91.ELSE
92OPENSSLINCDIR=external
93CDEFS+=-I$(SOLARINCDIR)$/$(OPENSSLINCDIR)
94.ENDIF
95.ENDIF
96
97# On Linux/Mac we need the content of CDEFS in CFLAGS so that the ssl headers are searched for
98.IF "$(OS)"=="MACOSX" || "$(OS)"=="LINUX"
99# in a directory that corresponds to the directory that is searched for the ssl library.
100CONFIGURE_FLAGS='CFLAGS=$(CDEFS)'
101.ENDIF
102
103BUILD_DIR=$(CONFIGURE_DIR)
104BUILD_ACTION=$(GNUMAKE)
105BUILD_FLAGS+= -j$(EXTMAXPROCESS)
106
107.IF "$(OS)"=="MACOSX"
108# Serf names its library only with the major number.
109# We are using minor and micro as well.  Fix that here
110# by creating a copy with the right name.
111SERF_ORIGINAL_LIB=.libs/libserf-$(SERF_MAJOR).0.dylib
112SERF_FIXED_LIB=.libs/libserf-$(LIBSERFVERSION).0.dylib
113INSTALL_ACTION=if [ -f "$(SERF_ORIGINAL_LIB)" -a ! -f "$(SERF_FIXED_LIB)" ]; then cp $(SERF_ORIGINAL_LIB) $(SERF_FIXED_LIB); fi
114.ENDIF
115
116OUT2INC+=serf*.h
117OUT2INC_SUBDIR=serf
118
119.IF "$(OS)"=="MACOSX"
120OUT2LIB+=$(SERF_FIXED_LIB)
121OUT2LIB+=.libs/libserf-1.*dylib
122.ELSE
123OUT2LIB=.libs/libserf-1.so*
124.ENDIF
125
126.ENDIF
127
128# --- Targets ------------------------------------------------------
129
130.INCLUDE : set_ext.mk
131.INCLUDE : target.mk
132.INCLUDE : tg_ext.mk
133
134.ENDIF
135