File: configure.in

package info (click to toggle)
libapache-csacek 2.1.9-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,500 kB
  • ctags: 1,773
  • sloc: ansic: 11,833; makefile: 454; yacc: 199; sh: 164; php: 51; sed: 5
file content (421 lines) | stat: -rw-r--r-- 11,814 bytes parent folder | download | duplicates (3)
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
dnl Process this file with autoconf to produce a configure script.

dnl $Id: configure.in,v 1.103 2002/02/03 10:56:41 dolecek Exp $

AC_REVISION($Revision: 1.103 $)
AC_INIT(bar.c)
AC_CONFIG_HEADER(csa_config.h)

# All global version parameters should be set here
PACKAGE="C-SaCzech"
SHELL=/bin/sh
CGI_CODES="ASCII ISO-8859-2 CP1250 ISO-8859-1 CP852 MAC UTF8"
COMPILEDIR="./compile"
CFLAGS="$CFLAGS"	dnl additional flags for C compiler
OPT="-O"  		dnl default optimalization

COMMON_OBJS="bar.o cmds.o compat.o compress.o cstools.o debug.o guess.o http.o info.o loop.o servlist.o share.o string.o zlib.o"
CGI_OBJS="$COMMON_OBJS alloc.o cgi.o"
APACHE_SRCS="apache.c apache_eapi.c "`echo $COMMON_OBJS $APACHE_OBJS | sed -e 's/\.o/.c/g'`
CGI_LINTFILES=`echo $CGI_OBJS | sed -e 's/\.o/.ln/g'`
FILE_OBJS="$COMMON_OBJS alloc.o file.o"

AC_SUBST(SHELL)
AC_SUBST(CGI_CODES)
AC_SUBST(COMPILEDIR)
AC_SUBST(CFLAGS)
AC_SUBST(OPT)
AC_DEFINE(CSACEK)
AC_SUBST(CGI_OBJS)
AC_SUBST(APACHE_SRCS)
AC_SUBST(CGI_LINTFILES)
AC_SUBST(FILE_OBJS)

### Canonicalize the configuration name.
CSA_SYSTEM_TYPE="`uname -s`/`uname -m`"
AC_DEFINE_UNQUOTED(CSA_SYSTEM_TYPE, "$CSA_SYSTEM_TYPE")

dnl Checks for programs.

AC_MSG_CHECKING(for --without-gcc)
AC_ARG_WITH(gcc, [  --without-gcc           do not use gcc, even if it is be available on system], [
        case $withval in
        no)     CC=cc
                without_gcc=yes;;
        yes)    CC=gcc
                without_gcc=no;;
        *)      CC=$withval
                without_gcc=$withval;;
        esac], [
        case `uname -s` in
        OSF1)   CC="cc -std"
                without_gcc=;;
        *)      without_gcc=no;;
        esac])
AC_MSG_RESULT([$without_gcc])

# If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then
  AC_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi

AC_PROG_CC

AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_PROG(CP, cp, cp, :)
AC_CHECK_PROG(STRIP, strip, strip, :)
AC_CHECK_PROG(RM, rm, rm, :)
AC_CHECK_PROG(BISON, bison, bison, :)
AC_CHECK_PROG(LINT, lint, lint, :)

#special care for gcc
if test X"$CC" = Xgcc; then
  CFLAGS="-Wall $CFLAGS"
  OPT="-O2"
fi

dnl Checks for libraries.
dnl check first if function is not in libc and AFTER that check other library
AC_CHECK_FUNC( socket, socket_found=1, socket_found=0 )
if test $socket_found -eq 0; then
AC_CHECK_LIB( socket, socket )
fi
AC_CHECK_FUNC( inet_addr, inet_addr_found=1, inet_addr_found=0 )
if test $inet_addr_found -eq 0; then
AC_CHECK_LIB( nsl, inet_addr )
fi
# check if we need to link with -lresolv (needed on UNIXWARE 2.01)
AC_CHECK_LIB( resolv, res_gethostbyname )
AC_CHECK_LIB( z, zlibVersion )

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_STAT
AC_HEADER_TIME
AC_CHECK_HEADERS(unistd.h fcgi_stdio.h zlib.h sys/cdefs.h stdarg.h \
	sys/time.h strings.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Checks for library functions.
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_CHECK_TYPE(size_t, unsigned long)
AC_CHECK_TYPE(signed, )

AC_CHECK_FUNCS( \
	memcpy mktime setenv putenv strchr \
	strerror strftime strstr toupper vprintf vsnprintf \
)

dnl alloca() needs special handling - it's presence won't be guessed
dnl when it would be checked by generic AC_CHECK_FUNCS() on some
dnl system/compiler combinations (namely AIX/gcc 2.8.1 didn't work)
AC_FUNC_ALLOCA  

dnl Other checks

dnl --with-defsource uz neni podporovano
if test X"$with_defsource" != X; then
	AC_CACHE_SAVE
	AC_MSG_ERROR([--with-defsource obsoleted, use --with-server-charset instead])
fi
	

AC_MSG_CHECKING([default server charset])
AC_ARG_WITH(server-charset,
	[  --with-server-charset=KOD    defaultni kodovani serveru [ISO-8859-2]],
	[  true ],
	[  true ]
	)

dnl if charset was not set, use iso-8859-2
if test X"$with_server_charset" = X; then
	with_server_charset="iso-8859-2"
fi
AC_MSG_RESULT([$with_server_charset])
AC_DEFINE_UNQUOTED(CSA_DEFSOURCE, "$with_server_charset")

AC_MSG_CHECKING([whether CSacek supports charset \"$with_server_charset\"])
if ! test -r cstools.c; then
	AC_CACHE_SAVE
	AC_MSG_ERROR([cannot open CSacek file cstools.c - are you in CSacek directory ?])
fi

codeset_supp=`cat cstools.c | sed -n '/^cstools_itab/,/^}; \/\* cstools_itab/p' | grep '"' | sed 's/.*"\(.*\)".*/\1/' | grep -i "^$with_server_charset\$"`
if test X"$codeset_supp" = X; then
	AC_MSG_RESULT([no])
	AC_CACHE_SAVE
	AC_MSG_ERROR([uknown charset \"$with_server_charset\"])
fi
AC_MSG_RESULT([yes])

AC_ARG_WITH(templatedir,
	[  --with-templatedir=DIR  adresar, ve kterem se nachazi sablony [/www/csacek]],
	[  true ],
	[  true ]
	)
if test X"$with_templatedir" != X; then
	CSA_TEMPLATEDIR="$with_templatedir"
else
	CSA_TEMPLATEDIR="/www/csacek"
fi
AC_DEFINE_UNQUOTED(CSA_TEMPLATEDIR, "$CSA_TEMPLATEDIR")
AC_MSG_RESULT([directory where CSacek templates will be installed... $CSA_TEMPLATEDIR])

dnl Test for obsolete --with-mutace
if test X"$with_mutace" != X; then
	AC_CACHE_SAVE
	AC_MSG_ERROR([--with-mutace is obsolete, use --with-target])
fi

AC_MSG_CHECKING([CSacek compile target])
AC_ARG_WITH(target,
        [  --with-target=MUTACE    zkompilovat CSacek v zadane mutaci [CGI]],
        [ true ],
        [ true ]
        )

if test X"$with_target" = X; then
	with_target="CGI"
fi
csacek_mutace=`echo $with_target | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
MUTACE_CANON="$csacek_mutace"
MUTACE="$with_target"
if test X"$csacek_mutace" = XCGI; then
	compile_target=CGI
elif test X"$csacek_mutace" = XFASTCGI; then
	compile_target=CGI
	LIBS="$LIBS -lfcgi"
elif test X"$csacek_mutace" = XAPACHE; then
	compile_target=APACHE
	if echo $LIBS | grep '\-lz' >/dev/null 2>&1; then
		LIBS="-lz"
	else
		LIBS=""
	fi
elif test X"$csacek_mutace" = XFILE; then
	compile_target=FILE
else
	AC_CACHE_SAVE
	AC_MSG_ERROR([Zadan neplatny nazev mutace ($MUTACE).  Podporovany jsou CGI, FastCGI a Apache.])
fi

AC_MSG_RESULT([$MUTACE])
AC_SUBST(MUTACE)
AC_SUBST(MUTACE_CANON)
AC_SUBST(compile_target)

AC_ARG_WITH(debug,
        [  --with-debug            zkompilovat verzi s DEBUG infem],
        [ true ],
        [ true ]
        )
DEBUG=""
if test X"$with_debug" != X -a X"$with_debug" != Xno; then
  if test X"$with_debug" = Xyes; then
	debug_value=1
  else
	debug_value="$with_debug"
  fi
  if test x"$CC" = xgcc; then
  	OPT="-g -O"
	CFLAGS="$CFLAGS -Wuninitialized -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  -Wsign-compare"
  else
	OPT="-g"
  fi
  AC_DEFINE_UNQUOTED(CSA_DEBUG, $debug_value)
  AC_MSG_RESULT([compiling DEBUG version])
  STRIP=":"
fi

dnl Switches
AC_MSG_CHECKING([decodequery])
AC_ARG_ENABLE(decodequery,
	[  --disable-decodequery   vstup predany pri POST, GET neprevadet do defaultniho
                          kodovani serveru],
	[ decodequery=no ],
	[ decodequery=yes ],
	)
if test $decodequery = yes -a X"$with_decodequery" != Xno; then
  AC_DEFINE(CSA_WANT_DECODEQUERY)
  AC_MSG_RESULT([on (client data will be recoded to server charset)])
else
  AC_MSG_RESULT([off (client data WON'T be recoded to server charset)])
fi


AC_MSG_CHECKING([CSacek report])
AC_ARG_ENABLE(report,
        [  --disable-report        neumoznit generovani HTML stranky s popisem
                          konfigurace CSacku],
        [ report=no ],
        [ report=yes ],
        )
if test $report = yes -a X"$with_report" != Xno; then
  AC_DEFINE(CSA_WANT_INFO)
  AC_MSG_RESULT([on])
else
  AC_MSG_RESULT([off])
fi

AC_MSG_CHECKING([compression support])
AC_ARG_ENABLE(compression,
        [  --disable-compression   nekompilovat podporu pro kompresi],
        [ true ],
        [ true ]
        )

if test X"$enable_compression" != Xno -a X"$with_compression" != Xno; then
  if test $ac_cv_lib_z_zlibVersion = yes; then
	if test $ac_cv_header_zlib_h = yes; then
		AC_MSG_RESULT([yes (using system zlib)])
		true
	else
		AC_MSG_RESULT([yes (using CSacek zlib - zlib headers not found)])
  		LIBS=`echo $LIBS | sed 's/\-lz//'`
	fi
  else
	AC_MSG_RESULT([yes (using CSacek zlib)])
  fi
  AC_DEFINE(CSA_WANT_COMPRESSION)
else
  AC_MSG_RESULT([disabled])
  LIBS=`echo $LIBS | sed 's/\-lz//'`
fi

AC_MSG_CHECKING([CSacek command tag])
AC_ARG_ENABLE(cmdtag,
        [  --with-cmdtag=X         tag oznacujici CSacek prikazy (max. jeden znak) [?]],
        [ true ],
        [ true ]
        )

if test X"$with_cmdtag" = Xno -o X"$with_cmdtag" = X; then
	cmdtag='?'
else
	cmdtag="$with_cmdtag"
fi
AC_DEFINE_UNQUOTED(CSA_CMD_TAG, '${cmdtag}')
AC_MSG_RESULT(['$cmdtag'])

# Apache specific stuff
if echo $MUTACE | grep -i APACHE >/dev/null 2>&1; then

AC_MSG_CHECKING([apxs])
AC_ARG_WITH(apxs,
	[  --with-apxs[=SOUBOR]    cesta ke skriptu apxs, nutnemu pro zkompilovani                                 DSO modulu pro Apache ],
	[ true ],
	[ true ]
	)

dnl if apxs was not set, find it
if test X"$with_apxs" = Xyes -o X"$with_apxs" = Xno -o X"$with_apxs" = X; then
	with_apxs="apxs"
else
	APXS="$with_apxs"
fi

if test ! -x "$with_apxs" -o ! -f "$with_apxs" ; then
	myApxs=`basename "$with_apxs"`
	APXS=""
  	for myPath in /usr/local/sbin /usr/pkg/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin `echo "$PATH" | sed -e 's/:/ /g'`
	do
		fname="$myPath/$myApxs"
		if test -f "$fname" -a -x "$fname"; then
			APXS="$fname"
			break
		fi
	done

	if test ! -z "$APXS" -a -f "$APXS" -a -x "$APXS" ; then
		AC_MSG_RESULT([found as $APXS])
	else
		APXS=":"
		AC_MSG_RESULT([APXS not found])
	fi
fi
AC_SUBST(APXS)

fi # end of Apache-specific stuff

# (Fast)CGI specific stuff
if echo $MUTACE | grep -i CGI >/dev/null 2>&1; then
  dnl use --program-suffix to specify suffix for names of scripts
  if test X"$program_suffix" = XNONE; then
	program_suffix=""
  else
	AC_MSG_RESULT([jmena skriptu budou opatreny priponou ... $program_suffix])
  fi
  AC_SUBST(program_suffix)

  AC_MSG_CHECKING([CGI CSacek retrieve method])
  AC_ARG_WITH(method,
	[  --with-method=METHOD    (Fast)CGI: metoda pouzita k predavani dokumentu (muze
                          byt guess, http,file)  [guess]],
	[  true ],
	[  with_method="guess" ]
	)
  dnl test if the method is good
  orig_method="$with_method"
  with_method=`echo $with_method | tr [A-Z] [a-z]`
  if test X"$with_method" != X"file" -a X"$with_method" != X"http" \
	-a X"$with_method" != X"guess"; then
    AC_CACHE_SAVE
    AC_MSG_ERROR( neznama metoda $orig_method - [ melo by byt guess, http nebo file ])
  fi

  if test X"$with_method" = Xguess; then
    AC_DEFINE(CSA_METHOD_GUESS)
  elif test X"$with_method" = Xhttp; then
    AC_DEFINE(CSA_METHOD_HTTP)
  elif test X"$with_method" = Xfile; then
    AC_DEFINE(CSA_METHOD_FILE)
  fi
  AC_MSG_RESULT([$with_method])

  AC_MSG_CHECKING([part names for generating CGI files])
  AC_ARG_WITH(partlist,
        [  --with-partlist=\"CASTI\" (Fast)CGI: seznam jmen casti (viz PART) pouzivanych
                          na serveru, oddelene mezerou [cs en]],
        [  PARTLIST="$withval" ],
        [  PARTLIST="cs en" ]
        )
  AC_MSG_RESULT([$PARTLIST])
  AC_SUBST(PARTLIST)

  AC_MSG_CHECKING([CGI CSacek security paranoia])
  AC_ARG_ENABLE(secure,
	[  --disable-secure        (Fast)CGI: netestovat existenci .htaccess resp.
                          .nsconfig na ceste k dokumentu (pri metode guess)],
	[ true ],
	[ true ]
 	)

  if test X"$enable_secure" != Xno -a X"with_secure" != Xno; then 
 	AC_DEFINE(CSA_WANT_SECURE)
	AC_MSG_RESULT([on])
  else
	AC_MSG_RESULT([off])
  fi

  AC_ARG_ENABLE(symlink,
	[  --disable-symlink       (Fast)CGI: binarku CGI CSacko rozkopirovat misto
                          pouziti symbolickych linku],
	[ true ],
	[ true ]
	)

  if test X"$enable_symlink" = Xno -o X"with_symlink" = Xno; then 
	LN_S="$CP"
  fi

fi

dnl That's all, folks

AC_OUTPUT(Makefile)