| 1 | # -*- Autoconf -*- |
|---|
| 2 | # Process this file with autoconf to produce a configure script. |
|---|
| 3 | |
|---|
| 4 | AC_PREREQ(2.59) |
|---|
| 5 | AC_INIT([Box Backup], 0.11, [boxbackup@boxbackup.org],[boxbackup]) |
|---|
| 6 | AC_CONFIG_SRCDIR([lib/common/Box.h]) |
|---|
| 7 | AC_CONFIG_HEADERS([lib/common/BoxConfig.h]) |
|---|
| 8 | |
|---|
| 9 | touch install-sh |
|---|
| 10 | AC_CANONICAL_SYSTEM |
|---|
| 11 | test -s install-sh || rm install-sh |
|---|
| 12 | |
|---|
| 13 | ### Checks for programs. |
|---|
| 14 | |
|---|
| 15 | AC_LANG([C++]) |
|---|
| 16 | AC_PROG_CC |
|---|
| 17 | AC_PROG_CXX |
|---|
| 18 | AC_CXX_EXCEPTIONS |
|---|
| 19 | AC_CXX_NAMESPACES |
|---|
| 20 | if test "x$ac_cv_cxx_exceptions" != "xyes" || \ |
|---|
| 21 | test "x$ac_cv_cxx_namespaces" != "xyes"; then |
|---|
| 22 | AC_MSG_ERROR([[basic compile checks failed, the C++ compiler is broken]]) |
|---|
| 23 | fi |
|---|
| 24 | |
|---|
| 25 | m4_include([infrastructure/m4/boxbackup_tests.m4]) |
|---|
| 26 | |
|---|
| 27 | ## Get tmpdir |
|---|
| 28 | temp_directory_name="/tmp" |
|---|
| 29 | AC_ARG_WITH( |
|---|
| 30 | [tmp-dir], |
|---|
| 31 | [AC_HELP_STRING([--with-tmp-dir=DIR], [Directory for temporary files [/tmp]])], |
|---|
| 32 | [temp_directory_name="$withval"]) |
|---|
| 33 | AC_DEFINE_UNQUOTED([TEMP_DIRECTORY_NAME], ["$temp_directory_name"], [TMP directory name]) |
|---|
| 34 | |
|---|
| 35 | ## Allow linking binaries with static libraries |
|---|
| 36 | AC_ARG_ENABLE( |
|---|
| 37 | [static-bin], |
|---|
| 38 | [AC_HELP_STRING([--enable-static-bin], [Link binaries with static libraries])]) |
|---|
| 39 | if test "x$enable_static_bin" = "xyes"; then |
|---|
| 40 | AC_CHECK_LIB([ssl],[SSL_read],,, [crypto]) |
|---|
| 41 | LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic" |
|---|
| 42 | fi |
|---|
| 43 | |
|---|
| 44 | # override default sysconfdir, for backwards compatibility |
|---|
| 45 | test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc |
|---|
| 46 | test "$localstatedir" = '${prefix}/var' && localstatedir=/var |
|---|
| 47 | |
|---|
| 48 | ## Kludge to allow makeparcels.pl to use bindir. This is not a good long term |
|---|
| 49 | ## solution because it prevents use of "make exec_prefix=/some/dir" |
|---|
| 50 | saved_prefix=$prefix |
|---|
| 51 | saved_exec_prefix=$exec_prefix |
|---|
| 52 | test "x$prefix" = xNONE && prefix=$ac_default_prefix |
|---|
| 53 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' |
|---|
| 54 | eval bindir_expanded=` eval "echo $bindir"` |
|---|
| 55 | eval sbindir_expanded=` eval "echo $sbindir"` |
|---|
| 56 | eval sysconfdir_expanded=` eval "echo $sysconfdir"` |
|---|
| 57 | eval localstatedir_expanded=`eval "echo $localstatedir"` |
|---|
| 58 | prefix=$saved_prefix |
|---|
| 59 | exec_prefix=$saved_exec_prefix |
|---|
| 60 | AC_SUBST([bindir_expanded]) |
|---|
| 61 | AC_SUBST([sbindir_expanded]) |
|---|
| 62 | AC_SUBST([sysconfdir_expanded]) |
|---|
| 63 | AC_SUBST([localstatedir_expanded]) |
|---|
| 64 | |
|---|
| 65 | ## Figure out the client parcel directory and substitute it |
|---|
| 66 | build_dir=`dirname $0` |
|---|
| 67 | build_dir=`cd $build_dir && pwd` |
|---|
| 68 | client_parcel_dir=`$PERL infrastructure/parcelpath.pl backup-client $target_os` |
|---|
| 69 | |
|---|
| 70 | if test "$build_os" = "cygwin"; then |
|---|
| 71 | client_parcel_dir=`cygpath -wa $client_parcel_dir | sed -e 's|\\\|/|g'` |
|---|
| 72 | build_dir=` cygpath -wa $build_dir | sed -e 's|\\\|/|g'` |
|---|
| 73 | fi |
|---|
| 74 | |
|---|
| 75 | AC_SUBST([client_parcel_dir]) |
|---|
| 76 | AC_SUBST([build_dir]) |
|---|
| 77 | |
|---|
| 78 | ## Figure out version and substitute it in |
|---|
| 79 | box_version=`$PERL infrastructure/printversion.pl` |
|---|
| 80 | AC_SUBST([box_version]) |
|---|
| 81 | |
|---|
| 82 | ### Output files |
|---|
| 83 | AC_CONFIG_FILES([infrastructure/BoxPlatform.pm |
|---|
| 84 | contrib/mac_osx/org.boxbackup.bbackupd.plist |
|---|
| 85 | contrib/mac_osx/org.boxbackup.bbstored.plist |
|---|
| 86 | contrib/solaris/bbackupd-manifest.xml |
|---|
| 87 | contrib/solaris/bbstored-manifest.xml |
|---|
| 88 | lib/common/BoxPortsAndFiles.h |
|---|
| 89 | test/bbackupd/testfiles/bbackupd.conf |
|---|
| 90 | test/bbackupd/testfiles/bbackupd-exclude.conf |
|---|
| 91 | test/bbackupd/testfiles/bbackupd-snapshot.conf |
|---|
| 92 | test/bbackupd/testfiles/bbackupd-symlink.conf |
|---|
| 93 | test/bbackupd/testfiles/bbackupd-temploc.conf |
|---|
| 94 | ]) |
|---|
| 95 | AX_CONFIG_SCRIPTS([bin/bbackupd/bbackupd-config |
|---|
| 96 | bin/bbackupquery/makedocumentation.pl |
|---|
| 97 | bin/bbstored/bbstored-certs |
|---|
| 98 | bin/bbstored/bbstored-config |
|---|
| 99 | contrib/debian/bbackupd |
|---|
| 100 | contrib/debian/bbstored |
|---|
| 101 | contrib/redhat/bbackupd |
|---|
| 102 | contrib/redhat/bbstored |
|---|
| 103 | contrib/suse/bbackupd |
|---|
| 104 | contrib/suse/bbstored |
|---|
| 105 | contrib/solaris/bbackupd-smf-method |
|---|
| 106 | contrib/solaris/bbstored-smf-method |
|---|
| 107 | contrib/windows/installer/boxbackup.mpi |
|---|
| 108 | infrastructure/makebuildenv.pl |
|---|
| 109 | infrastructure/makeparcels.pl |
|---|
| 110 | infrastructure/makedistribution.pl |
|---|
| 111 | lib/common/makeexception.pl |
|---|
| 112 | lib/raidfile/raidfile-config |
|---|
| 113 | lib/server/makeprotocol.pl |
|---|
| 114 | runtest.pl |
|---|
| 115 | test/backupstorefix/testfiles/testbackupstorefix.pl |
|---|
| 116 | test/bbackupd/testfiles/extcheck1.pl |
|---|
| 117 | test/bbackupd/testfiles/extcheck2.pl |
|---|
| 118 | test/bbackupd/testfiles/notifyscript.pl |
|---|
| 119 | test/bbackupd/testfiles/syncallowscript.pl]) |
|---|
| 120 | # TODO: Need to do contrib/cygwin/install-cygwin-service.pl but location varies |
|---|
| 121 | AC_OUTPUT |
|---|
| 122 | |
|---|
| 123 | # Configure the Box build system |
|---|
| 124 | echo |
|---|
| 125 | if ! $PERL ./infrastructure/makebuildenv.pl \ |
|---|
| 126 | || ! $PERL ./infrastructure/makeparcels.pl; then |
|---|
| 127 | echo "Making infrastructure failed!" |
|---|
| 128 | exit 1 |
|---|
| 129 | fi |
|---|
| 130 | |
|---|
| 131 | cat parcels.txt | sed -e 's/#.*//' | while read cmd subdir configure_args; do |
|---|
| 132 | if test "$cmd" = "subdir"; then |
|---|
| 133 | echo |
|---|
| 134 | export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS |
|---|
| 135 | args="$configure_args --target=$target_alias" |
|---|
| 136 | echo "Configuring $subdir with: $args" |
|---|
| 137 | |
|---|
| 138 | cd $subdir |
|---|
| 139 | if ! ./configure $args; then |
|---|
| 140 | echo "Configuring $subdir with $args failed!" >&2 |
|---|
| 141 | exit 1 |
|---|
| 142 | fi |
|---|
| 143 | fi |
|---|
| 144 | done || exit $? |
|---|
| 145 | |
|---|
| 146 | # Write summary of important info |
|---|
| 147 | tee config.log.features <<EOC |
|---|
| 148 | A summary of the build configuration is below. Box Backup will function |
|---|
| 149 | without these features, but will work better where they are present. Refer |
|---|
| 150 | to the documentation for more information on each feature. |
|---|
| 151 | |
|---|
| 152 | Regular expressions: $have_regex_support |
|---|
| 153 | Large files: $box_cv_have_large_file_support |
|---|
| 154 | Berkeley DB: $ax_path_bdb_ok |
|---|
| 155 | Readline: $have_libreadline |
|---|
| 156 | Extended attributes: $ac_cv_header_sys_xattr_h |
|---|
| 157 | EOC |
|---|
| 158 | |
|---|
| 159 | cat > config.env <<EOC |
|---|
| 160 | CC="$CC" |
|---|
| 161 | CXX="$CXX" |
|---|
| 162 | CXXFLAGS="$CXXFLAGS" |
|---|
| 163 | LDFLAGS="$LDFLAGS" |
|---|
| 164 | LIBS="$LIBS" |
|---|
| 165 | EOC |
|---|
| 166 | |
|---|
| 167 | ### Warnings at end for visibility |
|---|
| 168 | |
|---|
| 169 | if test "x$box_cv_gcc_3_plus" != "xyes" && test "x$box_cv_malloc_workaround" != "xyes"; then |
|---|
| 170 | echo |
|---|
| 171 | AC_MSG_WARN([[the implementation of the C++ STL on this platform may |
|---|
| 172 | have a flaw which causes it to apparently leak memory, and this flaw cannot be |
|---|
| 173 | worked around. |
|---|
| 174 | |
|---|
| 175 | When running the daemons, check their memory usage does not constantly |
|---|
| 176 | increase. The STL flaw can cause excessive memory use.]]) |
|---|
| 177 | fi |
|---|
| 178 | |
|---|
| 179 | case "$vl_cv_lib_readline" in |
|---|
| 180 | *readline*) |
|---|
| 181 | echo |
|---|
| 182 | AC_MSG_WARN([[do not distribute binaries compiled against GNU readline, |
|---|
| 183 | as this could violate the GNU readline licence, which is GPL. You may use |
|---|
| 184 | libedit or libeditline instead.]]) |
|---|
| 185 | ;; |
|---|
| 186 | esac |
|---|