]> err.no Git - backuppcd/blob - configure.ac
Import gnulib stuff
[backuppcd] / configure.ac
1 AC_INIT([backuppcd], 0.1.3)
2 AM_INIT_AUTOMAKE([1.9 foreign])
3 AC_CONFIG_HEADER(config.h)
4
5 dnl Checks for programs.
6 AC_GNU_SOURCE
7 AC_PROG_CC
8 gl_EARLY
9 AC_PROG_MAKE_SET
10 AC_PROG_INSTALL
11 AC_PROG_RANLIB
12 gl_INIT
13 AC_CHECK_TOOL(AR, ar, true)
14
15 AC_CHECK_HEADERS(stdlib.h string.h unistd.h time.h sys/time.h sys/types.h signal.h syslog.h sys/select.h netinet/in.h arpa/inet.h sys/socket.h ssl.h openssl/ssl.h ssl/ssl.h fcntl.h dirent.h ctype.h assert.h endian.h stdarg.h utime.h fnmatch.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h sys/resource.h limits.h)
16 AC_HEADER_TIME
17 AC_CHECK_FUNCS(sysinfo openlog syslog setsid fork fcntl stat lstat lchown symlink readlink signal getenv utime statfs getmntinfo setpriority)
18 AC_REPLACE_FUNCS(link)
19
20 dnl Large file support
21 AC_SYS_LARGEFILE
22 AC_FUNC_FSEEKO
23 AC_TYPE_OFF_T
24
25 PKG_CHECK_MODULES([SSL], [openssl])
26
27 AC_ARG_WITH(masterpw, AC_HELP_STRING([--with-masterpw], [Enable support for a hard-coded master password]), [ masterpw=$withval ], [ masterpw=no ])
28 if test "$masterpw" != "no"; then
29         if test "$masterpw" = "yes"; then
30                 AC_MSG_ERROR([Master password must be specified on the command line.])
31         fi
32         AC_DEFINE_UNQUOTED(BPC_CONF_MASTER_PASSWORD, "$masterpw", [Define to the master password])
33 fi
34
35 AC_ARG_WITH(updateurl, AC_HELP_STRING([--with-updateurl], [Enable support for a hard-coded update URL]), [ updateurl="$withval" ], [ updateurl=no ])
36 if test "$updateurl" != "no"; then
37         if test "$updateurl" = "yes"; then
38                 AC_MSG_ERROR([URL must be specified on the command line.])
39         fi
40         AC_DEFINE_UNQUOTED(BPC_CONF_UPDATEURL, "$updateurl", [Define to the URL to update against])
41 fi
42
43 AC_ARG_WITH(notifyserv, AC_HELP_STRING([--with-notifyserv], [Enable support for a hard-coded notification server]), [ notifyserv="$withval" ], [ notifyserv=no ])
44 if test "$notifyserv" != "no"; then
45         if test "$notifyserv" = "yes"; then
46                 AC_MSG_ERROR([Notification server must be specified on the command line.])
47         fi
48         AC_DEFINE_UNQUOTED(BPC_CONF_NOTIFYSERV, "$notifyserv", [Define to the server to send host notifications to])
49 fi
50
51 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support.]), [ debugenabled=$enableval ], [ debugenabled=no ])
52 if test "$debugenabled" = "no"; then
53         AC_DEFINE(NDEBUG, [1], [Define if you wish to disable debugging support])
54 else
55         AC_DEFINE(DEBUG, [1], [Define if you wish to enable debugging support])
56 fi
57
58 AC_C_BIGENDIAN(,, [
59         AC_DEFINE(ENDIAN_UNKNOWN, [1], [Define this to 1 if you do not know what endian-ness your platform is.])
60 ])
61
62 AC_OUTPUT(Makefile lib/Makefile)