summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac105
1 files changed, 77 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac
index 60caf9d5..a6e8c812 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,14 +2,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([Box Backup], 0.11, [boxbackup@fluffy.co.uk])
+AC_INIT([Box Backup], 0.11, [boxbackup@boxbackup.org])
AC_CONFIG_SRCDIR([lib/common/Box.h])
AC_CONFIG_HEADERS([lib/common/BoxConfig.h])
-# override default sysconfdir, for backwards compatibility
-AC_SUBST([sysconfdir], ['/etc'])dnl
-AC_SUBST([localstatedir], ['/var/run'])dnl
-
touch install-sh
AC_CANONICAL_SYSTEM
test -s install-sh || rm install-sh
@@ -24,11 +20,16 @@ if test "x$ac_cv_cxx_exceptions" != "xyes" || \
test "x$ac_cv_cxx_namespaces" != "xyes"; then
AC_MSG_ERROR([[basic compile checks failed, the C++ compiler is broken]])
fi
+
if test "x$GXX" = "xyes"; then
# Use -Wall if we have gcc. This gives better warnings
AC_SUBST([CXXFLAGS_STRICT], ['-Wall -Wundef'])
- # Use -rdynamic if we have gcc. This is needed for backtrace
- AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic'])
+
+ # Use -rdynamic if we have gcc, but not mingw. This is needed for backtrace
+ case $target_os in
+ mingw*) ;;
+ *) AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic']) ;;
+ esac
fi
AC_PATH_PROG([PERL], [perl], [AC_MSG_ERROR([[perl executable was not found]])])
@@ -46,11 +47,18 @@ AC_SUBST([TARGET_PERL])
AC_DEFINE_UNQUOTED([PERL_EXECUTABLE], ["$TARGET_PERL"],
[Location of the perl executable])
-AC_CHECK_PROGS([AR], [ar],
+AC_CHECK_TOOL([AR], [ar],
[AC_MSG_ERROR([[cannot find ar executable]])])
-AC_CHECK_PROGS([RANLIB], [ranlib],
+AC_CHECK_TOOL([RANLIB], [ranlib],
[AC_MSG_ERROR([[cannot find ranlib executable]])])
+case $target_os in
+mingw*)
+ AC_CHECK_TOOL([WINDRES], [windres],
+ [AC_MSG_ERROR([[cannot find windres executable]])])
+ ;;
+esac
+
### Checks for libraries.
case $target_os in
@@ -62,6 +70,7 @@ winnt) ;;
;;
esac
+AC_CHECK_HEADER([zlib.h],, [AC_MSG_ERROR([[cannot find zlib.h]])])
AC_CHECK_LIB([z], [zlibVersion],, [AC_MSG_ERROR([[cannot find zlib]])])
VL_LIB_READLINE([have_libreadline=yes], [have_libreadline=no])
@@ -112,7 +121,7 @@ esac
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([dlfcn.h execinfo.h getopt.h process.h pwd.h signal.h])
-AC_CHECK_HEADERS([syslog.h time.h])
+AC_CHECK_HEADERS([syslog.h time.h cxxabi.h])
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h])
AC_CHECK_HEADERS([sys/uio.h sys/xattr.h])
@@ -126,6 +135,7 @@ else
fi
if test "$have_pcreposix_h" = "yes"; then
+ AC_DEFINE([PCRE_STATIC], [1], [Box Backup always uses static PCRE])
AC_SEARCH_LIBS([regcomp], ["pcreposix -lpcre"],,[have_pcreposix_h=no_regcomp])
fi
@@ -150,7 +160,6 @@ AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, uint64_t])
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_BIGENDIAN
-AX_CHECK_NONALIGNED_ACCESS
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
@@ -159,6 +168,8 @@ AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_flags])
AC_CHECK_MEMBERS([struct stat.st_mtimespec])
+AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec])
+AC_CHECK_MEMBERS([struct stat.st_atimensec])
AC_CHECK_MEMBERS([struct sockaddr_in.sin_len],,, [[
#include <sys/types.h>
#include <netinet/in.h>
@@ -170,6 +181,10 @@ AC_CHECK_DECLS([INFTIM],,, [[#include <poll.h>]])
AC_CHECK_DECLS([SO_PEERCRED],,, [[#include <sys/socket.h>]])
AC_CHECK_DECLS([O_BINARY],,,)
+# Solaris provides getpeerucred() instead of getpeereid() or SO_PEERCRED
+AC_CHECK_HEADERS([ucred.h])
+AC_CHECK_FUNCS([getpeerucred])
+
AC_CHECK_DECLS([optreset],,, [[#include <getopt.h>]])
AC_CHECK_DECLS([dirfd],,,
[[
@@ -207,13 +222,15 @@ AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_TYPE_SIGNAL
AC_FUNC_STAT
-AC_CHECK_FUNCS([getpeereid lchown setproctitle getpid gettimeofday])
+AC_CHECK_FUNCS([getpeereid lchown setproctitle getpid gettimeofday waitpid])
+
# NetBSD implements kqueue too differently for us to get it fixed by 0.10
# TODO: Remove this when NetBSD kqueue implementation is working
netbsd_hack=`echo $target_os | sed 's/netbsd.*/netbsd/'`
if test "$netbsd_hack" != "netbsd"; then
AC_CHECK_FUNCS([kqueue])
fi
+
AX_FUNC_SYSCALL
AX_CHECK_SYSCALL_LSEEK
AC_CHECK_FUNCS([listxattr llistxattr getxattr lgetxattr setxattr lsetxattr])
@@ -224,14 +241,16 @@ AC_CHECK_DECLS([XATTR_NOFOLLOW],,, [[#include <sys/xattr.h>]])
## Check for large file support active. AC_SYS_LARGEFILE has already worked
## out how to enable it if necessary, we just use this to report to the user
-AC_CACHE_CHECK([if we have large file support enabled], [have_large_file_support],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]], [[
+AC_CACHE_CHECK([if we have large file support enabled], [box_cv_have_large_file_support],
+ [AC_TRY_RUN([AC_LANG_PROGRAM([[$ac_includes_default]], [[
return sizeof(off_t)==4;
]])],
- [have_large_file_support=yes], [have_large_file_support=no]
+ [box_cv_have_large_file_support=yes],
+ [box_cv_have_large_file_support=no],
+ [box_cv_have_large_file_support=no # safe for cross-compile]
)])
-if test "x$have_large_file_support" = "xyes"; then
+if test "x$box_cv_have_large_file_support" = "xyes"; then
AC_DEFINE([HAVE_LARGE_FILE_SUPPORT], [1],
[Define to 1 if large files are supported])
fi
@@ -271,23 +290,56 @@ if test "x$enable_static_bin" = "xyes"; then
LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic"
fi
+# override default sysconfdir, for backwards compatibility
+test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
+test "$localstatedir" = '${prefix}/var' && localstatedir=/var
+
## Kludge to allow makeparcels.pl to use bindir. This is not a good long term
## solution because it prevents use of "make exec_prefix=/some/dir"
saved_prefix=$prefix
saved_exec_prefix=$exec_prefix
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-bindir_expanded=` eval "echo $bindir"`
-bindir_expanded=` eval "echo $bindir_expanded"`
-sysconfdir_expanded=` eval "echo $sysconfdir"`
-localstatedir_expanded=`eval "echo $localstatedir"`
+eval bindir_expanded=` eval "echo $bindir"`
+eval sbindir_expanded=` eval "echo $sbindir"`
+eval sysconfdir_expanded=` eval "echo $sysconfdir"`
+eval localstatedir_expanded=`eval "echo $localstatedir"`
prefix=$saved_prefix
exec_prefix=$saved_exec_prefix
-AC_SUBST([bindir_expanded sysconfdir_expanded localstatedir_expanded])
+AC_SUBST([bindir_expanded])
+AC_SUBST([sbindir_expanded])
+AC_SUBST([sysconfdir_expanded])
+AC_SUBST([localstatedir_expanded])
+
+## Figure out the client parcel directory and substitute it
+build_dir=`dirname $0`
+build_dir=`cd $build_dir && pwd`
+client_parcel_dir=`$PERL infrastructure/parcelpath.pl backup-client $target_os`
+
+if test "$build_os" = "cygwin"; then
+ client_parcel_dir=`cygpath -wa $client_parcel_dir | sed -e 's|\\\|/|g'`
+ build_dir=` cygpath -wa $build_dir | sed -e 's|\\\|/|g'`
+fi
+
+AC_SUBST([client_parcel_dir])
+AC_SUBST([build_dir])
+## Figure out version and substitute it in
+box_version=`$PERL infrastructure/printversion.pl`
+AC_SUBST([box_version])
### Output files
-AC_CONFIG_FILES([infrastructure/BoxPlatform.pm])
+AC_CONFIG_FILES([infrastructure/BoxPlatform.pm
+ contrib/mac_osx/org.boxbackup.bbackupd.plist
+ contrib/mac_osx/org.boxbackup.bbstored.plist
+ contrib/solaris/bbackupd-manifest.xml
+ contrib/solaris/bbstored-manifest.xml
+ lib/common/BoxPortsAndFiles.h
+ test/bbackupd/testfiles/bbackupd.conf
+ test/bbackupd/testfiles/bbackupd-exclude.conf
+ test/bbackupd/testfiles/bbackupd-snapshot.conf
+ test/bbackupd/testfiles/bbackupd-symlink.conf
+ ])
AX_CONFIG_SCRIPTS([bin/bbackupd/bbackupd-config
bin/bbackupquery/makedocumentation.pl
bin/bbstored/bbstored-certs
@@ -298,20 +350,17 @@ AX_CONFIG_SCRIPTS([bin/bbackupd/bbackupd-config
contrib/redhat/bbstored
contrib/suse/bbackupd
contrib/suse/bbstored
- contrib/solaris/bbackupd-manifest.xml
- contrib/solaris/bbstored-manifest.xml
contrib/solaris/bbackupd-smf-method
contrib/solaris/bbstored-smf-method
+ contrib/windows/installer/boxbackup.mpi
infrastructure/makebuildenv.pl
infrastructure/makeparcels.pl
infrastructure/makedistribution.pl
- lib/common/BoxPortsAndFiles.h
lib/common/makeexception.pl
lib/raidfile/raidfile-config
lib/server/makeprotocol.pl
runtest.pl
test/backupstorefix/testfiles/testbackupstorefix.pl
- test/bbackupd/testfiles/bbackupd.conf
test/bbackupd/testfiles/extcheck1.pl
test/bbackupd/testfiles/extcheck2.pl
test/bbackupd/testfiles/notifyscript.pl
@@ -334,7 +383,7 @@ without these features, but will work better where they are present. Refer
to the documentation for more information on each feature.
Regular expressions: $have_regex_support
-Large files: $have_large_file_support
+Large files: $box_cv_have_large_file_support
Berkeley DB: $ax_path_bdb_ok
Readline: $have_libreadline
Extended attributes: $ac_cv_header_sys_xattr_h
@@ -343,7 +392,7 @@ EOC
### Warnings at end for visibility
-if test "x$gcc_3_plus" != "xyes" && test "x$malloc_workaround" != "xyes"; then
+if test "x$box_cv_gcc_3_plus" != "xyes" && test "x$box_cv_malloc_workaround" != "xyes"; then
echo
AC_MSG_WARN([[the implementation of the C++ STL on this platform may
have a flaw which causes it to apparently leak memory, and this flaw cannot be