[go: up one dir, main page]

File: configure.ac

package info (click to toggle)
awffull 3.8.2-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,952 kB
  • ctags: 923
  • sloc: ansic: 9,935; sh: 4,472; perl: 276; makefile: 79; sed: 16
file content (293 lines) | stat: -rw-r--r-- 10,011 bytes parent folder | download | duplicates (2)
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.ac 474 2007-11-14 05:56:35Z steve $

AC_INIT([awffull], [3.8.2], [spm@stedee.id.au])
AC_PREREQ([2.59])
AC_CONFIG_SRCDIR([src/awffull.c])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADER(src/config.h:src/config-h.in)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

dnl Grab the current CFLAGS variable - gets set by other tests otherwise
OLD_CFLAGS=${CFLAGS}
if test "x$CFLAGS" = "x"; then
    CFLAGS="-O2"
fi

AM_GNU_GETTEXT_VERSION([0.15])
AM_GNU_GETTEXT([external])

AC_REVISION($Revision: 1.1 $)

dnl Checks for programs.
AC_PROG_CC

OPTS=${DEFS}
AC_SUBST(OPTS)


dnl ********************
dnl Set CFLAGS to use
dnl  Use extra optimisations if using gcc
if test "x$OLD_CFLAGS" = "x"; then
    if test "x$CC" = "xgcc"; then
        CFLAGS="-O3 -fexpensive-optimizations"
    else
        CFLAGS="-O2"
    fi
fi

dnl ********************
dnl Config Arg: --enable-debug
dnl  Enable the debug flag for compiling
dnl ********************
AC_ARG_ENABLE([debug],
              AS_HELP_STRING([--enable-debug],
                             [Turn on compiler debugging information (default=no)]),
                             [if eval "test x$enable_debug = xyes"; then
                              CFLAGS="${CFLAGS} -Wall -g"
                          fi])


dnl ********************
dnl Config Arg: --enable-developer
dnl  Enable maximum warnings. Base taken from Samba.
dnl ********************
AC_ARG_ENABLE([developer],
              AS_HELP_STRING([--enable-developer],
                             [Turn on developer warnings and debugging (default=no)]),
                             [if eval "test x$enable_developer = xyes"; then
                                  CFLAGS="${OLD_CFLAGS} -g -pg -Wall -Wshadow -Wstrict-prototypes -DDEVELOPER"
                              else
                                  if eval "test x$enable_developer != xno"; then
                                      CFLAGS="${OLD_CFLAGS} -g -pg -Wall $enable_developer -DDEVELOPER"
                                  fi
                          fi])


dnl ********************
dnl Config Arg: --enable-coverage
dnl  Enable the coverage testing
dnl ********************
AC_ARG_ENABLE([coverage],
              AS_HELP_STRING([--enable-coverage],
                             [Turn on compiler coverage testing: gcov (default=no)]),
                             [if eval "test x$enable_coverage = xyes"; then
                              CFLAGS="${OLD_CFLAGS} -Wall -fprofile-arcs -ftest-coverage"
                          fi])


dnl ********************
dnl Config Arg: --enable-static
dnl ********************
AC_ARG_ENABLE([static],
              AS_HELP_STRING([--enable-static],
                             [Build as static executable (default=no)]),
                             [if eval "test x$enable_static = xyes"; then
                              LDFLAGS="--static ${LDFLAGS}"
                          fi])

              
dnl ********************
dnl Config Arg: --enable-geoip
dnl ********************
ENABLE_GEOIP="yes"
AC_ARG_ENABLE([geoip],
              AS_HELP_STRING([--disable-geoip],
                             [Disable GeoIP (default=no)]),
                             [if eval "test x$enable_geoip = xno"; then
                              ENABLE_GEOIP="no"
                          fi])

              
dnl ********************
dnl Config Arg: --enable-ttf
dnl ********************
ENABLE_TTF="yes"
AC_ARG_ENABLE([ttf],
              AS_HELP_STRING([--disable-ttf],
                             [Disable TrueType Fonts (default=no)]),
                             [if eval "test x$enable_ttf = xno"; then
                              ENABLE_TTF="no"
                          fi])

              
dnl ********************
dnl Config Arg: --with-etcdir
dnl ********************
AC_ARG_WITH([etcdir],
            AS_HELP_STRING([--with-etcdir=DIR],
                           [Where to look for default config file (default=/etc)]),
                           [ETCDIR="${withval}"], 
                           [CACHE_ETC="yes"])


dnl ********************
dnl Config Arg: --with-gd
dnl ********************
AC_ARG_WITH([gd],
            AS_HELP_STRING([--with-gd=DIR],
                           [Where to additionally look for gd header files]),
                           [EXTRA_GD="${withval}" CFLAGS="-I${withval} ${CFLAGS}"],
                           [EXTRA_GD=""])


dnl ********************
dnl Config Arg: --with-gdlib
dnl ********************
AC_ARG_WITH([gdlib],
            AS_HELP_STRING([--with-gdlib=DIR],
                           [Alternate location for libgd library]),
                           [EXTRA_GDLIB="${withval}"],
                           [EXTRA_GDLIB=""])


dnl ********************
dnl Config Arg: --with-z
dnl ********************
AC_ARG_WITH([z],
            AS_HELP_STRING([--with-z=DIR],
                           [Alternate location for libz header files]),
                           [CFLAGS="-I${withval} ${CFLAGS}"])


dnl ********************
dnl Config Arg: --with-zlib
dnl ********************
AC_ARG_WITH([zlib],
            AS_HELP_STRING([--with-zlib=DIR],
                           [Alternate location for libz library]),
                           [LDFLAGS="-L${withval} ${LDFLAGS}"])


dnl ********************
dnl Config Arg: --with-png
dnl ********************
AC_ARG_WITH([png],
            AS_HELP_STRING([--with-png=DIR],
                           [Alternate location of png header files]),
                           [CFLAGS="-I${withval} ${CFLAGS}"])


dnl ********************
dnl Config Arg: --with-pnglib
dnl ********************
AC_ARG_WITH([pnglib],
            AS_HELP_STRING([--with-pnglib=DIR],
                           [Alternate location for libpng library]),
                           [LDFLAGS="-L${withval} ${LDFLAGS}"])


dnl ********************
dnl Config Arg: --with-geoip
dnl ********************
AC_ARG_WITH([geoip],
            AS_HELP_STRING([--with-geoip=DIR],
                           [Alternate location of geoip header files]),
                           [CFLAGS="-I${withval} ${CFLAGS}"])


dnl ********************
dnl Config Arg: --with-geoiplib
dnl ********************
AC_ARG_WITH([geoiplib],
            AS_HELP_STRING([--with-geoiplib=DIR],
                           [Alternate location for libGeoIP library]),
                           [LDFLAGS="-L${withval} ${LDFLAGS}"])


dnl ********************
dnl Config Arg: --with-font-default
dnl ********************
AH_TEMPLATE([FONTDEFAULT],
            [Define if need to override the Default TrueType Font location.])

AC_ARG_WITH([font-default],
            AS_HELP_STRING([--with-font-default=FILE],
                           [Where to look for the Default TrueType Font]),
                           AC_DEFINE_UNQUOTED([FONTDEFAULT], ["${withval}"]))

dnl ********************
dnl Config Arg: --with-font-label
dnl ********************
AH_TEMPLATE([FONTLABEL],
            [Define if need to override the Default Label TrueType Font location.])

AC_ARG_WITH([font-label],
            AS_HELP_STRING([--with-font-label=FILE],
                           [Where to look for the Default Label TrueType Font]),
                           AC_DEFINE_UNQUOTED([FONTLABEL], ["${withval}"]))


dnl ********************
dnl   LIBRARY CHECKING
dnl ********************
AC_PROG_RANLIB
AC_FUNC_MKTIME
AC_CHECK_LIB([m], [main],[], [echo "Missing Math Library" ; exit])
AC_CHECK_LIB([z], [main],[], [echo "Missing Z Compression Library" ; exit])
AC_CHECK_LIB([png], [main],[], [echo "Missing PNG Library" ; exit])
AC_CHECK_LIB([gd], [gdImagePng],[], [echo "Missing GD Library" ; exit])

if test "$ENABLE_TTF" = "yes"; then
    dnl #define HAVE_GDIMAGESTRINGFT in config.h if we can do GD TrueType Text
    AC_CHECK_LIB([gd], [gdImageStringFT],
                 [AC_DEFINE([HAVE_GDIMAGESTRINGFT], [1], [Define if gdImageStringFT Exists])],
                 [echo "Missing GD TrueType Font Capability"])

    dnl #define HAVE_GDFTUSEFONTCONFIG in config.h if we can do GD TrueType Font Config
    AC_CHECK_LIB([gd], [gdFTUseFontConfig],
                 [AC_DEFINE([HAVE_GDFTUSEFONTCONFIG], [1], [Define if gdFTUseFontConfig Exists])],
                 [echo "Missing GD TrueType Font Config Capability"])
fi

AC_CHECK_LIB([pcre], [main],[], [echo "Missing Perl Reg. Ex. Library" ; exit])
if test "$ENABLE_GEOIP" = "yes"; then
    AC_CHECK_LIB([GeoIP], [main],[], [echo "Missing GeoIP Library" ; ENABLE_GEOIP="no"])
fi

dnl Checks for library functions.
dnl - messes up Solaris - AC_FUNC_MALLOC
AC_CHECK_FUNC([getopt_long], [], [echo "Missing getopt_long Function" ; exit])
AC_CHECK_FUNCS([floor memset strlcpy])

dnl ********************
dnl   HEADER CHECKING
dnl ********************
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_CHECK_HEADERS([getopt.h], [], [echo "Missing getopt.h" ; exit])
AC_CHECK_HEADERS([math.h], [], [echo "Missing math.h" ; exit])
AC_CHECK_HEADERS([zlib.h], [], [echo "Missing zlib.h" ; exit])
AC_CHECK_HEADERS([pcre.h], [],
                 [ AC_CHECK_HEADERS([pcre/pcre.h], [], [ echo "Missing pcre.h" ; exit ] ])
         )
AC_CHECK_HEADERS([ctype.h], [], [echo "Missing ctype.h" ; exit])
AC_CHECK_HEADERS([sys/utsname.h], [], [echo "Missing sys/utsname.h" ; exit])
AC_CHECK_HEADERS([sys/times.h], [], [echo "Missing sys/times.h" ; exit])
if test "$ENABLE_GEOIP" = "yes"; then
    AC_CHECK_HEADERS([GeoIP.h], [], [echo "Missing GeoIP.h"])
fi


dnl ********************
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ********************
AC_C_CONST
AC_STRUCT_TM
AC_TYPE_SIZE_T

AC_MSG_CHECKING(default config dir)
if test "$CACHE_ETC" = "yes"; then
 AC_CACHE_VAL(ac_cv_etcdir, ac_cv_etcdir=/etc)
 ETCDIR=$ac_cv_etcdir
fi
ac_cv_etcdir=$ETCDIR
AC_MSG_RESULT($ETCDIR)
AC_SUBST(ETCDIR)

AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile flags/Makefile po/Makefile.in contrib/Makefile])
AC_OUTPUT