source: box/trunk/configure.ac @ 3075

Revision 3075, 6.4 KB checked in by chris, 10 days ago (diff)

Disable automatic backups in the temploc configuration, and enable the
NotifyScript, so that we can tell what kind of errors bbackupd reported
and reproduce them reliably.

  • Property svn:eol-style set to native
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT([Box Backup], 0.11, [boxbackup@boxbackup.org],[boxbackup])
6AC_CONFIG_SRCDIR([lib/common/Box.h])
7AC_CONFIG_HEADERS([lib/common/BoxConfig.h])
8
9touch install-sh
10AC_CANONICAL_SYSTEM
11test -s install-sh || rm install-sh
12
13### Checks for programs.
14
15AC_LANG([C++])
16AC_PROG_CC
17AC_PROG_CXX
18AC_CXX_EXCEPTIONS
19AC_CXX_NAMESPACES
20if 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]])
23fi
24
25m4_include([infrastructure/m4/boxbackup_tests.m4])
26
27## Get tmpdir
28temp_directory_name="/tmp"
29AC_ARG_WITH(
30  [tmp-dir],
31  [AC_HELP_STRING([--with-tmp-dir=DIR], [Directory for temporary files [/tmp]])],
32  [temp_directory_name="$withval"])
33AC_DEFINE_UNQUOTED([TEMP_DIRECTORY_NAME], ["$temp_directory_name"], [TMP directory name])
34
35## Allow linking binaries with static libraries
36AC_ARG_ENABLE(
37  [static-bin],
38  [AC_HELP_STRING([--enable-static-bin], [Link binaries with static libraries])])
39if test "x$enable_static_bin" = "xyes"; then
40  AC_CHECK_LIB([ssl],[SSL_read],,, [crypto])
41  LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic"
42fi
43
44# override default sysconfdir, for backwards compatibility
45test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
46test "$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"
50saved_prefix=$prefix
51saved_exec_prefix=$exec_prefix
52test "x$prefix" = xNONE && prefix=$ac_default_prefix
53test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
54eval bindir_expanded=`       eval "echo $bindir"`
55eval sbindir_expanded=`      eval "echo $sbindir"`
56eval sysconfdir_expanded=`   eval "echo $sysconfdir"`
57eval localstatedir_expanded=`eval "echo $localstatedir"`
58prefix=$saved_prefix
59exec_prefix=$saved_exec_prefix
60AC_SUBST([bindir_expanded])
61AC_SUBST([sbindir_expanded])
62AC_SUBST([sysconfdir_expanded])
63AC_SUBST([localstatedir_expanded])
64
65## Figure out the client parcel directory and substitute it
66build_dir=`dirname $0`
67build_dir=`cd $build_dir && pwd`
68client_parcel_dir=`$PERL infrastructure/parcelpath.pl backup-client $target_os`
69
70if 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'`
73fi
74
75AC_SUBST([client_parcel_dir])
76AC_SUBST([build_dir])
77
78## Figure out version and substitute it in
79box_version=`$PERL infrastructure/printversion.pl`
80AC_SUBST([box_version])
81
82### Output files
83AC_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                 ])
95AX_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
121AC_OUTPUT
122
123# Configure the Box build system
124echo
125if ! $PERL ./infrastructure/makebuildenv.pl \
126|| ! $PERL ./infrastructure/makeparcels.pl; then
127        echo "Making infrastructure failed!"
128        exit 1
129fi
130
131cat 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
144done || exit $?
145
146# Write summary of important info
147tee config.log.features <<EOC
148A summary of the build configuration is below. Box Backup will function
149without these features, but will work better where they are present. Refer
150to the documentation for more information on each feature.
151
152Regular expressions: $have_regex_support
153Large files:         $box_cv_have_large_file_support
154Berkeley DB:         $ax_path_bdb_ok
155Readline:            $have_libreadline
156Extended attributes: $ac_cv_header_sys_xattr_h
157EOC
158
159cat > config.env <<EOC
160CC="$CC"
161CXX="$CXX"
162CXXFLAGS="$CXXFLAGS"
163LDFLAGS="$LDFLAGS"
164LIBS="$LIBS"
165EOC
166
167### Warnings at end for visibility
168
169if 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
172have a flaw which causes it to apparently leak memory, and this flaw cannot be
173worked around.
174
175When running the daemons, check their memory usage does not constantly
176increase. The STL flaw can cause excessive memory use.]])
177fi
178
179case "$vl_cv_lib_readline" in
180  *readline*)
181    echo
182    AC_MSG_WARN([[do not distribute binaries compiled against GNU readline,
183as this could violate the GNU readline licence, which is GPL. You may use
184libedit or libeditline instead.]])
185    ;;
186esac
Note: See TracBrowser for help on using the repository browser.