-
Notifications
You must be signed in to change notification settings - Fork 45
/
configure.ac
152 lines (127 loc) · 4.08 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#
# Fast RPC RPC library suports XML and binary format.
# Copyright (C) 2005-7 Seznam.cz, a.s.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Seznam.cz, a.s.
# Radlicka 2, Praha 5, 15000, Czech Republic
# http://www.seznam.cz, mailto:[email protected]
#
#
# $Id: configure.in,v 1.52 2011-02-25 09:31:03 volca Exp $
#
# DESCRIPTION
# configure template for fastrpc.
#
# AUTHORS
# Miroslav Talasek <[email protected]>
#
# HISTORY
# 2004-02-14 (miro)
# Created.
#
# initialize autoconf
AC_INIT([fastrpc], [8.1.14], [email protected])
# initialize automake(use AC_INIT's arguments)
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_MACRO_DIR([m4])
# tell autoconf where to find sources
AC_CONFIG_SRCDIR([src/frpcvalue.cc])
AC_PREREQ(2.50)
AC_CANONICAL_HOST
case $host in
*solaris*)
AC_ARG_ENABLE(m64, AS_HELP_STRING([--enable-m64],[enable 64bit mode]), [
AC_MSG_CHECKING(for -m64 linker options)
CPPFLAGS="-m64 -DSOLARIS"
CXXFLAGS="-m64 -DSOLARIS"
CFLAGS="-m64 -DSOLARIS"
LDFLAGS="-m64 -L/opt/csw/lib/amd64 -L/usr/local/lib/amd64"
sbindir='${exec_prefix}/sbin/amd64'
bindir='${exec_prefix}/bin/amd64'
libdir='${exec_prefix}/lib/amd64'
AC_MSG_RESULT([-m64 flag set])],
[LDFLAGS="-L/opt/csw/lib -L/usr/local/lib"
CPPFLAGS="-DSOLARIS"
CXXFLAGS="-DSOLARIS"
CFLAGS="-DSOLARIS"])
;;
esac
# check for C compiled
AC_PROG_CC
# check for C++ compiler
AC_PROG_CXX
# check for std C headers
AC_HEADER_STDC
# check for libtool
AC_PROG_LIBTOOL
AC_LANG_CPLUSPLUS
case $host in
*solaris*)
AC_ARG_ENABLE(m64, [enable 64bit mode], [], [
AC_CHECK_LIB(z,gzopen64, , AC_MSG_ERROR(Cannot find libz library!))])
;;
esac
m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([Please install pkg-config.])])
PKG_PROG_PKG_CONFIG
# pkg-config resolvable dependencies for consistent .pc file wit configure
# script;
# add new pkg-config dependencies here
PC_DEPS="libxml-2.0"
AC_SUBST([PC_DEPS])
PKG_CHECK_MODULES([DEPS], [$PC_DEPS])
dnl ------------------------------------------------------------------------
# system dependant part
# search for socket related libraries
AC_SEARCH_LIBS(getnetbyname, socket, , )
AC_SEARCH_LIBS(hstrerror, resolv, , )
AC_SEARCH_LIBS(inet_ntoa, nsl, , )
dnl ------------------------------------------------------------------------
# This version number needs to be changed in several different ways for each
# release. Please read the libtool documentation (info libtool 'Updating
# version info') before touching this.
FASTRPC_MAJOR=8
FASTRPC_MINOR=0
VERSION_INFO="-version-info 14:0:1"
AC_ARG_ENABLE(optimization,[ --enable-optimization compile optimized without debug logging],[
case "${enableval}" in
no)
AC_MSG_NOTICE([disabling optimization.])
CPPFLAGS="${CPPFLAGS} -DDEBUG=1"
;;
yes)
AC_MSG_NOTICE([enabling optimization.])
CXXEXTRAFLAGS="${CXXEXTRAFLAGS} -O2"
CPPFLAGS="${CPPFLAGS} -UDEBUG"
;;
*)
AC_MSG_ERROR([Say yes or no to --enable-optimization.])
;;
esac
], [
CPPFLAGS="${CPPFLAGS} -DDEBUG=1"
])
AC_SUBST(FASTRPC_MAJOR)
AC_SUBST(FASTRPC_MINOR)
AC_SUBST(VERSION_INFO)
AC_SUBST(CXXEXTRAFLAGS)
# generate Makefile
AC_CONFIG_FILES([src/frpcversion.h
Makefile
src/Makefile
version
libfastrpc.pc])
AC_OUTPUT()