forked from seznam/teng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
150 lines (122 loc) · 3.9 KB
/
configure.in
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
#
# Teng -- a general purpose templating engine.
# Copyright (C) 2004 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.
# Naskove 1, Praha 5, 15000, Czech Republic
# http://www.seznam.cz, mailto:teng@firma.seznam.cz
#
#
# $Id: configure.in,v 1.24 2010-06-11 07:46:26 burlog Exp $
#
# DESCRIPTION
# configure template for Teng.
#
# AUTHORS
# Vaclav Blazek <blazek@firma.seznam.cz>
#
# HISTORY
# 2003-09-17 (vasek)
# Created.
#
# initialize autoconf
AC_INIT(teng, m4_esyscmd([head -n1 debian/changelog | tr -d '()' | cut -d' ' -f2 | tr -d '\n']), opensource@firma.seznam.cz)
AC_PROG_LIBTOOL
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AC_PREREQ(2.50)
#
AM_SILENT_RULES
# tell autoconf where to find sources
AC_CONFIG_SRCDIR([src/teng.cc])
# check for C++ compiler
AC_PROG_CXX
# pkg config
PKG_PROG_PKG_CONFIG([0.25])
DEPENS_NAMES="glib-2.0 libcurl"
PKG_CHECK_MODULES([DEPENS], [${DEPENS_NAMES}])
AC_SUBST(DEPENS_NAMES)
AC_SUBST(DEPENS)
# check for std C headers
AC_HEADER_STDC
# check for libtool
AC_PROG_LIBTOOL
# 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. (this is *.so version number).
TENG_MAJOR=3
TENG_MINOR=0
VERSION_INFO="-version-info $TENG_MAJOR:$TENG_MINOR:1"
AC_SUBST(TENG_MAJOR)
AC_SUBST(TENG_MINOR)
AC_SUBST(VERSION_INFO)
CPPFLAGS=""
CXXFLAGS=""
CFLAGS=""
LDFLAGS=""
AC_ARG_ENABLE(optimization,[ --enable-optimization compile optimized without debug logging],[
case "${enableval}" in
no)
AC_MSG_NOTICE([disabling optimization.])
CPPFLAGS="${CPPFLAGS} -DDEBUG=1 -O0 -g -ggdb"
;;
yes)
AC_MSG_NOTICE([enabling optimization.])
CPPFLAGS="${CPPFLAGS} -O2 -g -ggdb"
;;
*)
AC_MSG_ERROR([Say yes or no to --enable-optimization.])
;;
esac
], [
CPPFLAGS="${CPPFLAGS} -O2 -g -ggdb"
])
AC_ARG_ENABLE(lock-udf,[ --disable-udf-locks compile without thread safe UDF],[
case "${enableval}" in
no)
AC_MSG_NOTICE([enabling UDF locks])
CPPFLAGS="${CPPFLAGS} -UNO_UDF_LOCKS"
check_pthreads="no"
;;
yes)
AC_MSG_NOTICE([enabling optimization.])
CPPFLAGS="${CPPFLAGS} -DNO_UDF_LOCKS=1"
check_pthreads="yes"
;;
*)
AC_MSG_ERROR([Say yes or no to --disable-udf-locks])
;;
esac
], [
CPPFLAGS="${CPPFLAGS} -UNO_UDF_LOCKS"
check_pthreads="yes"
])
# check for flex and bison
AM_PROG_LEX
AC_PROG_YACC
# check for special header files
AC_CHECK_HEADERS(fenv.h)
# check for functions that may miss on some platforms
AC_CHECK_LIB(m, floor)
AC_REPLACE_FUNCS([trunc round])
AC_CHECK_LIB([pcre++], [_init],,AC_MSG_ERROR([pcre++ not installed]))
AS_IF([test x$check_pthreads == xyes], [
# Check for nonglibc header from serr library. The library is not
# needed just this header.
AC_CHECK_LIB(pthread, pthread_rwlock_rdlock,, AC_MSG_ERROR([pthread_rwlock_rdlock not found]))
], [])
# generate Makefile
AC_OUTPUT(version Makefile src/Makefile src/tengconfig.h libteng.pc)
# doc/Makefile doc/manual/Makefile doc/manual/en/Makefile)