File: configure.ac

package info (click to toggle)
biosquid 1.9g%2Bcvs20050121-15.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,632 kB
  • sloc: ansic: 12,750; sh: 1,412; perl: 243; makefile: 231
file content (306 lines) | stat: -rw-r--r-- 10,137 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
294
295
296
297
298
299
300
301
302
303
304
305
306
# Process this file with autoconf to produce a configure script.
# SRE, Wed Jul 19 11:57:36 2000
# CVS $Id: configure.ac,v 1.4 2003/06/13 20:05:31 eddy Exp $
#
# Hint: See autoconf macro archive at 
#     http://www.gnu.org/software/ac-archive/


# AC_INIT information.
#
# The four AC_INIT args set the following output variables and preprocessor symbols:
#     PACKAGE_NAME      <package>     e.g. "SQUID"
#     PACKAGE_VERSION   <version>     e.g. "1.9a"
#     PACKAGE_BUGREPORT <bug-report>  e.g. "eddy@genetics.wustl.edu"
#     PACKAGE_TARNAME   <tarname>     e.g. "squid"
# From them, it derives one more:
#     PACKAGE_STRING    <package> <version>, e.g. "SQUID 1.9a"
# We define some of our own:
#     SQUID_RELCODE     unique package/version CVS tag without .'s: e.g. "squid1_9a"
#     SQUID_DATE        release date: e.g. "January 2003"
#     SQUID_COPYRIGHT   one-line copyright string
#     SQUID_LICENSE     one-line license string
#     SQUID_LICENSETAG  which license to bundle from Licenses/ subdirectory.
#
# Because SQUID is designed to be a library and must coexist with
# packages that include it as a subdirectory (HMMER, INFERNAL...),
# we don't want to use AC_INIT's PACKAGE_ variables as preprocessor
# symbols to put version info into executables; we'll get name clashes,
# plus we might want to have both squid version info and main package
# version info. So, we use the PACKAGE_ stuff to make a
# new preprocessor symbol of our own:
#     SQUID_VERSION    e.g. "1.9a"
#
# The preprocessor symbols (version info) goes into squidconf.h.
# Output variables are used in Makefiles.
#
AC_PREREQ(2.57)
AC_INIT(SQUID, 1.9g, eddy@genetics.wustl.edu, squid)

AM_INIT_AUTOMAKE([1.6 foreign dist-zip tar-ustar filename-length-max=299])
LIB_VERSION=1:0
AC_SUBST([LIB_VERSION])

AC_MSG_NOTICE([configuring the SQUID library for your system.])

# Write out squidconf.h header
AC_CONFIG_HEADER(squidconf.h)

SQUID_RELCODE="squid1_9g"
SQUID_DATE="January 2003"
SQUID_COPYRIGHT="Copyright (C) 1992-2003 HHMI/Washington University School of Medicine"
SQUID_LICENSE="Freely distributed under the GNU General Public License (GPL)"
SQUID_LICENSETAG=gnu
SQUID_VERSION=$PACKAGE_VERSION

# Make output variables.
AC_SUBST(SQUID_RELCODE)
AC_SUBST(SQUID_DATE)
AC_SUBST(SQUID_COPYRIGHT)
AC_SUBST(SQUID_LICENSE)
AC_SUBST(SQUID_LICENSETAG)
AC_SUBST(SQUID_VERSION)


# Make preprocessor symbols.
AC_DEFINE_UNQUOTED(SQUID_DATE, "$SQUID_DATE", "Release date")
AC_DEFINE_UNQUOTED(SQUID_COPYRIGHT, "$SQUID_COPYRIGHT", "copyright info")
AC_DEFINE_UNQUOTED(SQUID_LICENSE, "$SQUID_LICENSE", "Short license info")
AC_DEFINE_UNQUOTED(SQUID_VERSION, "$SQUID_VERSION", "Version")



# Checks for programs.
#
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_LIBTOOL
AC_PATH_PROG([AR], [ar], [:], [$PATH:/usr/ccs/bin:/usr/xpg4/bin])

# We know we use GNU make, but we require this EXEC_DEPENDENCY

EXEC_DEPENDENCY='%: %_main.o'
AC_SUBST(EXEC_DEPENDENCY)


# ================================================================
# Provide for unsigned integers of known size
# Sets SQD_UINT16, 32, and 64.
# Will substitute for @SQD_UINT16@, etc. in an output file (config.h)
# Substitutes "FIXME" if no appropriate typedef is found.
# This info is substituted in squid.h.
# SRE, Thu Dec 28 13:58:51 2000
#
AC_C_BIGENDIAN()
AC_CHECK_FUNCS(ntohs, , AC_CHECK_LIB(socket, ntohs))
AC_CHECK_FUNCS(ntohl, , AC_CHECK_LIB(socket, ntohl))
AC_CHECK_FUNCS(htons, , AC_CHECK_LIB(socket, htons))
AC_CHECK_FUNCS(htonl, , AC_CHECK_LIB(socket, htonl))

AC_CHECK_SIZEOF(unsigned short, 2)
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned long, 4)
AC_CHECK_SIZEOF(unsigned long long, 8)
AC_CHECK_FUNCS(strtoul strtoull)
if test "$ac_cv_sizeof_unsigned_short" = "2"; then
  SQD_UINT16="unsigned short    "
else
  SQD_UINT16="FIXME"
  AC_MSG_WARN("No 16-bit int? Manually edit config file to typedef sqd_uint16.")
fi
if test "$ac_cv_sizeof_unsigned_int" = "4"; then
  SQD_UINT32="unsigned int      "
elif test "$ac_cv_sizeof_unsigned_long" = "4"; then
  SQD_UINT32="unsigned long     "
else
  SQD_UINT32="FIXME"
  AC_MSG_WARN("No 32-bit int? Manually edit config file to typedef sqd_uint32.")
fi
if test "$ac_cv_sizeof_unsigned_long" = "8"; then
  SQD_UINT64="unsigned long     "
elif test "$ac_cv_sizeof_unsigned_long_long" = "8"; then
  SQD_UINT64="unsigned long long"
else
  SQD_UINT64="FIXME"
  AC_MSG_WARN("No 64-bit int? Manually edit config file to typedef sqd_uint64.")
fi
AC_SUBST(SQD_UINT16)
AC_SUBST(SQD_UINT32)
AC_SUBST(SQD_UINT64)
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


# ================================================================
# Test for whether we can cheat and treat fpos_t
# (used by fgetpos() and fsetpos()) as an arithmetic datatype.
# This is essential if we're to be able to save an fpos_t to a file
# in an architecture-neutral format. We need this on FreeBSD
# systems, which don't provide a 64-bit ftell64() or ftello(),
# so we have to use fgetpos().
#
# if true, squidconf.h will contain
#   #define ARITHMETIC_FPOS_T 1
# else if false, 
#   #undef ARITHMETIC_FPOS_T
AC_DEFUN(SQ_ARITHMETIC_FPOS_T, [
   AC_MSG_CHECKING(whether fpos_t is an arithmetic datatype)
   fpos_arithmetic="no."
   AC_TRY_COMPILE([#include <stdio.h>],
      [int main(void) { fpos_t f1, f2; if (f1 == f2) f1 = 0;}],
      [ARITHMETIC_FPOS_T=1
      fpos_arithmetic="yes."])
   AC_MSG_RESULT($fpos_arithmetic)
])
SQ_ARITHMETIC_FPOS_T()

AC_DEFINE(ARITHMETIC_FPOS_T, [], "have fpos_t")
AC_SUBST(ARITHMETIC_FPOS_T)
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# ================================================================
# Tests for 64-bit file offset functions
# Note: only AC_CHECK_FUNCS seems to properly define HAVE_FOO?
#
AC_CHECK_FUNCS(strtoull)
AC_CHECK_FUNCS(ftello fseeko)
AC_CHECK_FUNCS(ftello64 fseeko64)
AC_CHECK_FUNCS(ftell64 fseek64)

AC_CHECK_FUNC(stat64, 
   [AC_MSG_CHECKING(for struct stat64)
    stat64_struct="no!"	    
    AC_TRY_COMPILE([#include <sys/types.h>
                    #include <sys/stat.h>
                    #include <unistd.h>],
                   [int main(void) { struct stat64 s1;} ],
	           [HAVE_STAT64=1
                    stat64_struct="yes."])
    AC_MSG_RESULT($stat64_struct)]
)
AC_DEFINE(HAVE_STAT64, 0, "have struct stat64")
AC_SUBST(HAVE_STAT64)
AC_CHECK_SIZEOF(off_t)
AC_CHECK_SIZEOF(off64_t)
AC_CHECK_SIZEOF(fpos_t)
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


#################################################################################
# Now we're into our "optional features"
#################################################################################


# --enable-ccmalloc      - configure for compiling in ccmalloc memory checks
#
# The CC output variable is modified.
# Requires ccmalloc version >= 0.4.0, because it uses --no-wrapper.
#
AC_ARG_ENABLE(ccmalloc,
[  --enable-ccmalloc       turn ccmalloc memory debugging on ],
[case $enable_ccmalloc in
   yes)  AC_MSG_NOTICE([enabled ccmalloc memory debugging])
         CC="ccmalloc --no-wrapper $CC" 
         ;;
    no)  AC_MSG_NOTICE([ccmalloc memory debug/tracing disabled])
         ;;
     *)  echo "Ignoring unknown argument to --enable-ccmalloc: $enable_ccmalloc"
	 ;;
esac])



AC_DEFINE(DEBUGLEVEL, 0, "Debugging level")
# --enable-debugging=x    - set debugging level to <x> (1-3)
# 
# At all levels, including 0, replaces CFLAGS w/ "-g -Wall" (so it assumes gcc).
# Sets the DEBUGLEVEL preprocessor symbol to <x>
#
AC_ARG_ENABLE(debugging,
[  --enable-debugging      set CFLAGS for debugging
  --enable-debugging=x    also set diagnostics level to <x> (1-3) (3 = most verbose)],
[ case $enable_debugging in
   yes)  AC_MSG_NOTICE([enabled debugging diagnostics level 0 (CFLAGS only, no verbosity)])
         CFLAGS="-g -Wall"
         DEBUGLEVEL=0
         ;;
     1)  AC_MSG_NOTICE([enabled debugging diagnostics level 1 (low verbosity)])
         CFLAGS="-g -Wall"
         DEBUGLEVEL=1
         ;;
     2)  AC_MSG_NOTICE([enabled debugging diagnostics level 2 (moderate verbosity)])
         CFLAGS="-g -Wall"
	 DEBUGLEVEL=2
         ;;
     3)  AC_MSG_NOTICE([enabled debugging diagnostics level 3 (high verbosity)])
         CFLAGS="-g -Wall"
	 DEBUGLEVEL=3
         ;;
    no)  AC_MSG_NOTICE([debugging diagnostics disabled])
         DEBUGLEVEL=0
         ;;
     *)  echo "Ignoring unknown argument to --enable-debugging: $enable_debugging"
	 ;;
esac])

AC_SUBST(DEBUGLEVEL) 

# --enable-lfs           Large File Summit (LFS) support for >2GB files
# See: http://ftp.sas.com/standards/large.file/x_open.20Mar96.html
#
AC_ARG_ENABLE(lfs, 
[  --enable-lfs            enable LFS, Large File Support],
[case $enable_lfs in
   yes) AC_MSG_NOTICE([configured for optional LFS, large file support])
	_LARGEFILE_SOURCE=1
	_LARGEFILE64_SOURCE=1
	_FILE_OFFSET_BITS=64
        ;;
   no)  ;;
    *)  echo "Ignoring unknown argument to --enable-lfs: $enable_lfs"
        ;;
esac])
AC_DEFINE(_LARGEFILE_SOURCE, 0, "Source supports large files")
AC_DEFINE(_LARGEFILE64_SOURCE, 0, "Source supports large files")
AC_DEFINE(_FILE_OFFSET_BITS, 64, "Size of file offset bits)
AC_SUBST(_LARGEFILE_SOURCE)
AC_SUBST(_LARGEFILE64_SOURCE)
AC_SUBST(_FILE_OFFSET_BITS)





# --enable-pvm       Enable Parallel Virtual Machine (PVM) support
# 
# Sets PVMLIBDIR, PVMINCDIR, PCMPROGS, PVMLIBS output variables
# Sets SRE_ENABLE_PVM preprocessor variable.
#
AC_ARG_ENABLE(pvm, 
[  --enable-pvm            enable PVM, Parallel Virtual Machine],
[case $enable_pvm in
   yes)  AC_MSG_NOTICE([enabled optional PVM (Parallel Virtual Machine) support])
 	 PVMLIBDIR="-L${PVM_ROOT}/lib/${PVM_ARCH}"
	 PVMINCDIR="-I${PVM_ROOT}/include"
	 PVMLIBS="-lpvm3"
	 SRE_ENABLE_PVM=1
	 ;;
   no)   AC_MSG_NOTICE([PVM (Parallel Virtual machine) support disabled])
         ;;
   *)    echo "Ignoring unknown argument to --enable-pvm: $enable_pvm"
	 ;;
esac])
AC_SUBST(PVMLIBDIR)
AC_SUBST(PVMINCDIR)
AC_SUBST(PVMLIBS)

# Write out Makefiles, and squid.h also has some output variable substitution.
AC_CONFIG_FILES([
	Makefile
        Testsuite/Makefile
        squid.h
	libsquid.pc
	])

AC_OUTPUT