libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / nocat / configure.ac
blob2bceae8c95f835aaaf1f0db378045efc4da95330
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(nocat, [0.93pre2], [schuyler@nocat.net], [NoCatSplash])
3 AC_CONFIG_SRCDIR([src/http.c])
4 AM_CONFIG_HEADER(src/config.h)
5 AM_INIT_AUTOMAKE
6 AM_MAINTAINER_MODE
8 # Checks for programs.
9 AC_PROG_CC
10 AC_PROG_MAKE_SET
11 AC_PROG_RANLIB
13 # Checks for libraries.
14 # FIXME: Replace `main' with a function in `-lsplash':
15 # AC_CHECK_LIB([splash], [http_request_new])
16 AM_PATH_GLIB( 1.2.0, :, AC_MSG_ERROR([You must have glib-1.2 installed.]), : )
18 # Checks for header files.
19 AC_HEADER_STDC
20 AC_HEADER_SYS_WAIT
21 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
23 # Checks for typedefs, structures, and compiler characteristics.
24 AC_C_CONST
25 AC_TYPE_OFF_T
26 AC_TYPE_PID_T
28 # Checks for library functions.
29 AC_FUNC_FORK
30 AC_FUNC_MMAP
31 AC_TYPE_SIGNAL
32 AC_FUNC_STRTOD
33 AC_CHECK_FUNCS([munmap socket strchr strcspn strrchr strstr strtol])
35 # Make sure we have values for prefix and exec_prefix
36 if test "$prefix" = "NONE"; then
37     prefix="$ac_default_prefix"
39 if test "$exec_prefix" = "NONE"; then
40     exec_prefix="$prefix"
42 if test "$pkgdatadir" = ""; then
43     pkgdatadir="$datadir/$PACKAGE_NAME"
46 # which g/w mode?
47 AC_ARG_WITH(mode,
48     [  --with-mode             Authentication mode (open) ],
49     [case "${withval}" in
50        open) splashd_mode="open.c" ;;
51        passive) 
52             splashd_mode="passive.c base64.c"
53             AC_CHECK_LIB([crypt], [crypt])
54             ;;
55        *) AC_MSG_ERROR(bad value ${withval} for --with-mode) ;;
56      esac
57     AC_DEFINE_UNQUOTED(NC_SPLASHD_MODE, "${withval}",
58         [Which mode the gateway runs in.])
59     ],
60     splashd_mode="open.c"
62 AC_SUBST(SPLASHD_MODE, "$splashd_mode")
64 AC_ARG_WITH(remote-splash,
65     [  --with-remote-splash   Fetch splash page from elsewhere with libghttp. ],
66     AC_CHECK_LIB([ghttp], [ghttp_request_new])
69 # with ghttpd?
70 AC_ARG_WITH(ghttpd,
71     [  --with-ghttpd           Build and install ghttpd, a lightweight httpd.],
72     AC_SUBST(GHTTPD_PROGRAM, "ghttpd"),
73     :
76 # Check for firewall software
77 supported_fw=`find libexec/ -type d ! -path "*CVS*" -exec echo -n "{} " \;`
78 AC_ARG_WITH(firewall,
79     [  --with-firewall=FW      Firewall to configure NoCat for.],
80     firewall="$withval",
81     AC_CHECK_PROGS(firewall, `cd ./libexec; ls | grep -v CVS`, "")
83 if test "$firewall" = ""; then
84     AC_MSG_ERROR(No supported firewalls found in \$PATH.)
86 AC_SUBST(libexecscripts,
87     `find libexec/$firewall -type f ! -path "*CVS*" -exec echo -n "{} " \;`)
88 AC_SUBST(pkglibexecdir, $libexecdir/$PACKAGE_NAME)
89 eval "NC_FIREWALL_PATH=`eval echo ${pkglibexecdir}`"
90 AC_DEFINE_UNQUOTED(NC_FIREWALL_PATH, "$NC_FIREWALL_PATH",
91     [Where to find firewall scripts?])
93 # Check for htdocs files
94 AC_ARG_WITH(docroot,
95     [  --with-docroot=PATH     Directory to store HTML templates in.],
96     htdocsdir="$withval", htdocsdir="${pkgdatadir}/htdocs")
97 AC_SUBST(htdocsdir)
98 AC_SUBST(imagesdir, $htdocsdir/images)
99 eval "NC_DOCUMENT_ROOT=`eval echo ${htdocsdir}`"
100 AC_DEFINE_UNQUOTED(NC_DOCUMENT_ROOT, "$NC_DOCUMENT_ROOT",
101     [Where to serve documents from?])
103 # Where do I find nocat.conf?
104 eval "NC_CONF_PATH=`eval echo ${sysconfdir}`"
105 AC_DEFINE_UNQUOTED(NC_CONF_PATH, "$NC_CONF_PATH",
106     [Where to find our nocat.conf, by default])
108 eval "NC_STATE_DIR=`eval echo ${localstatedir}`"
109 AC_DEFINE_UNQUOTED(NC_STATE_DIR, "$NC_STATE_DIR",
110     [Where to chdir after daemonizing, by default])
112 AC_DEFINE_UNQUOTED(NC_PID_FILE, "$NC_STATE_DIR/run/splashd.pid",
113     [Where to store our PID file, by default])
115 # PGP files?
116 AC_SUBST(pgpdir, "$pkgdatadir/pgp")
117 eval "NC_PGP_PATH=`eval echo ${pgpdir}`"
118 AC_DEFINE_UNQUOTED(NC_PGP_PATH, "$NC_PGP_PATH",
119     [Where to find our PGP keys?])
121 # Build makefiles
122 AC_CONFIG_FILES([Makefile
123                  src/Makefile])
124 AC_OUTPUT