-
Notifications
You must be signed in to change notification settings - Fork 30
/
configure.ac
79 lines (67 loc) · 2.02 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
AC_PREREQ(2.59)
AC_INIT([IP2Loc], [8.6.1], [[email protected]])
AM_INIT_AUTOMAKE([ subdir-objects ])
AM_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_C_CONST
AC_C_BIGENDIAN
dnl Check for some target-specific stuff
case "$host" in
*-*-freebsd*)
# FreeBSD forgot to install magic.h in a sane location. Bug or Feature?
CPPFLAGS="$CPPFLAGS -I/usr/include -I/usr/src/contrib/file/"
LDFLAGS="$LDFLAGS -L/usr/lib -R/usr/lib"
CFLAGS="$CFLAGS -lrt"
;;
*-*-linux*)
CPPFLAGS="$CPPFLAGS -D _GNU_SOURCE -I/usr/include -Wno-unused-result"
LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS -lrt"
;;
*-*-darwin*)
CPPFLAGS="$CPPFLAGS -I/opt/include"
LDFLAGS="$LDFLAGS -L/opt/lib"
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -no-cpp-precomp"
fi
;;
esac
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_CHECK_HEADERS([netinet/in.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_UID_T
AC_STRUCT_TM
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(off_t)
AC_DEFUN([AC_DEFINE_DIR], [
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}. Thus we have to use `eval' twice.
eval ac_define_dir="\"[$]$2\""
eval ac_define_dir="\"$ac_define_dir\""
AC_SUBST($1, "$ac_define_dir")
AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
test "$prefix_NONE" && prefix=NONE
test "$exec_prefix_NONE" && exec_prefix=NONE
])
AC_DEFINE_DIR(PREFIX, prefix, [default working directory])
AC_DEFINE_DIR(LOCALESTATEDIR, localstatedir, [where to put logs etc])
AC_DEFINE_DIR(LIBDIR, libdir, [where to look for plugins])
AC_DEFINE_DIR(SYSCONFDIR, [sysconfdir], [System configuration dir])
AC_CONFIG_FILES([Makefile
libIP2Location/Makefile
test/Makefile
data/Makefile])
AC_OUTPUT([
contrib/IP2Location.spec
])