-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
101 lines (82 loc) · 1.81 KB
/
configure.ac
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
dnl Process this file with autoconf to produce a configure script.
MAJOR_VERSION=0
MINOR_VERSION=2
RELEASE_NUMBER=0
SUBRELEASE_NUMBER=0
AC_CONFIG_SRCDIR([eolfix.c])
AC_PREREQ(2.52)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
dnl AC_PROG_LIBTOOL
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
case "${host}" in
*-pc-os2* )
AC_DEFINE([__OS2__], [], [OS/2 Operating System])
;;
*-darwin* )
AC_DEFINE([__OSX__], [], [Mac OS X Operating System])
;;
esac
dnl Checks for header files.
AC_HEADER_STDC([])
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([\
dirent.h \
fcntl.h \
fnmatch.h \
getopt.h \
stdlib.h \
string.h \
strings.h \
sys/file.h \
sys/stat.h \
sys/time.h \
sys/utime.h \
time.h \
unistd.h \
utime.h \
])
AC_C_INLINE
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_TYPES(ssize_t)
AC_CHECK_TYPES([struct timeval], [], [],
[#include <sys/time.h>
#include <time.h>])
AC_TYPE_SIZE_T
AC_CHECK_FUNCS(\
chown \
fnmatch \
getopt \
getopt_long \
getpid \
gettimeofday \
lstat \
mkstemps \
opendir \
strcasecmp \
)
if test "$ac_cv_func_getopt_long" = "no"; then
dnl FreeBSD has a gnugetopt library
AC_CHECK_LIB([gnugetopt], [getopt_long], [HAVE_GETOPT_LONG="yes"])
LDFLAGS="${LDFLAGS} -L/usr/local/lib"
for lib in gnugetopt; do
AC_CHECK_LIB($lib, getopt_long, [AC_DEFINE(HAVE_GETOPT_LONG)
LIBS="${LIBS} -l$lib"; break])
done
fi
AM_CONDITIONAL([USE_LOCAL_GETOPT], [test "$ac_cv_func_getopt_long" = "no"])
to_debug=no
AC_ARG_ENABLE(debug, [ --enable-debug enable debug build],
[to_debug="$enableval"])
if test "$to_debug" = "yes" ; then
CFLAGS="${CFLAGS} -O0 -g -D_DEBUG=1"
else
CFLAGS="${CFLAGS} -O2 -DNDEBUG=1"
fi
dnl AC_CONFIG_FILES([Makefile doc/Makefile])
AC_OUTPUT([Makefile doc/Makefile])
dnl configure.ac ends here