forked from mcgrof/glimpse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
144 lines (127 loc) · 4.18 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(get_filename.c)
AC_CONFIG_HEADER(libtemplate/include/autoconf.h)
AC_PROG_CC
dnl Check to see where to find ar. -- mkh
AC_PATH_PROG(AR, ar, ar)
if test -z "$AR" ; then
AC_PATH_PROG(AR, ar, , /usr/ccs/bin/ar)
if test -z "$AR" ; then
AC_MSG_ERROR([no acceptable ar found in \$PATH:/usr/ccs/bin/ar])
fi
fi
AC_PROG_RANLIB
AC_PROG_LN_S
dnl configure for dynfilter
AC_PROG_LEX
if test "x$LEX" = "xflex" ; then
DYNFILTER_TARGET=htuml2txt.so
LEXFLAGS="-F -8"
else
DYNFILTER_TARGET=htuml2txt
LEXFLAGS=
fi
if test "$ac_cv_prog_gcc" = "yes" ; then
DYNFILTER_CFLAGS="-O3 -fomit-frame-pointer"
else
DYNFILTER_CFLAGS="-O"
fi
if test "`uname`" = "Linux" ; then
DYNFILTER=dynfilters
else
DYNFILTER=
fi
dnl Check for strip, to support the --enable-strip option. -- mkh
AC_PATH_PROG(STRIP, strip, strip)
dnl Check for cp, this should not be a problem. -- mkh
AC_PATH_PROG(CP, cp, cp)
if test -z "$CP" ; then
AC_MSG_ERROR([no cp found in \$PATH, something weird is going on.])
fi
AC_PROG_INSTALL
dnl Checks for header files.
AC_HEADER_DIRENT
#Contribution by VaX#n8 <vax@linkdead.paranoia.com>
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h unistd.h sys/select.h)
dnl XXX sysuh
AC_CHECK_HEADERS(sys/dir.h sys/ndir.h strerr.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
dnl ######### compiler characteristics
AC_C_CONST
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
#AC_CHECK_FUNCS(getcwd gethostname gettimeofday mkdir rmdir select socket strdup strftime strstr)
# Need this for libtemplate
AC_CHECK_FUNCS(strdup strerror)
dnl Check for libraries
# fmod, logb, and frexp are found in -lm on most systems.
# On HPUX 9.01, -lm does not contain logb, so check for sqrt.
AC_CHECK_LIB(m, sqrt)
AC_CHECK_LIB(c, dlopen, , [AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"])])
#AC_CHECK_LIB(resolv, gethostbyname)
#AC_CHECK_LIB(nsl, gethostname, [LIBS="$LIBS -lnsl"])
#AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"])
#Contribution by: Larry Schwimmer schwim@cyclone.stanford.edu
AC_CHECK_FUNC(connect, , ac_check_socket=1)
if test "$ac_check_socket" = 1; then
AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", ac_check_both=1)
fi
if test "$ac_check_both" = 1; then
ac_old_libs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
AC_CHECK_FUNC(accept, checknsl=0, LIBS=$ac_old_libs)
fi
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
dnl Optional stuff
AC_ARG_WITH(file-end-mark,
[ --with-file-end-mark=CHAR use character CHAR as filename delimiter [' '] most often set to '\t' in order to index filenames with spaces; must match Webglimpse setting in lib/wgHeader.pm.],
AC_DEFINE_UNQUOTED(FILE_END_MARK,'$withval'),
AC_DEFINE(FILE_END_MARK,[' ']))
dnl AC_DEFINE(FILE_END_MARK, [$withval])
dnl TARGET=Sall,
dnl AC_DEFINE(FILE_END_MARK, [' '])
dnl TARGET=Sall)
AC_ARG_ENABLE(structured-queries,
[ --enable-structured-queries enable structured queries],
AC_DEFINE(STRUCTURED_QUERIES,1)
TARGET=Sall,
AC_DEFINE(STRUCTURED_QUERIES,0)
TARGET=NOTSall)
AC_ARG_ENABLE(iso-charset,
[ --disable-iso-charset disable iso charset (may be slightly faster if you don't care about upper-ascii characters)],
[use_iso=$enablevel],
[use_iso=yes])
AC_ARG_ENABLE(sfs-compat,
[ --enable-sfs-compat Support SFS compatibility],
AC_DEFINE(SFS_COMPAT,1),
AC_DEFINE(SFS_COMPAT,0))
AC_ARG_ENABLE(pointer,
[ --enable-pointer blah],
,
AC_DEFINE(AGREP_POINTER))
AC_ARG_ENABLE(measure-times,
[ --enable-measure-times blah],
AC_DEFINE(MEASURE_TIMES))
AC_ARG_ENABLE(warnings,
[ --enable-warnings Add -Wall to CFLAGS],
[CFLAGS="$CFLAGS -Wall"])
AC_ARG_ENABLE(strip,
[ --enable-strip Strip binaries],
,
[STRIP=""])
if test $use_iso = yes; then
AC_DEFINE(ISO_CHAR_SET,1)
else
AC_DEFINE(ISO_CHAR_SET,0)
fi
dnl local substitute
AC_SUBST(TARGET)
AC_SUBST(HAVE_STRDUP)
AC_SUBST(LEXFLAGS)
AC_SUBST(DYNFILTER_TARGET)
AC_SUBST(DYNFILTER_CFLAGS)
AC_SUBST(DYNFILTER)
AC_OUTPUT(Makefile index/Makefile compress/Makefile agrep/Makefile dynfilters/Makefile libtemplate/Makefile libtemplate/util/Makefile libtemplate/template/Makefile libtemplate/lib/Makefile)