source: trunk/debathena/third/schroot/configure.ac @ 24169

Revision 24169, 29.0 KB checked in by broder, 15 years ago (diff)
Only use silent-rules in automake if it's available. This permits compiling with an older automake. (Patch by Geoffrey Thomas)
Line 
1#                                                              -*- Autoconf -*-
2# Copyright © 2004-2009  Roger Leigh <rleigh@debian.org>
3#
4# schroot is free software: you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# schroot is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program.  If not, see
16# <http://www.gnu.org/licenses/>.
17#
18#####################################################################
19#
20# Process this file with autoconf to produce a configure script.
21#
22#####################################################################
23dnl MAKING RELEASES (a step-by-step guide!)
24dnl ===============
25dnl
26dnl Since the last release:
27dnl 1. if only source code (not the interface) has changed, set
28dnl      SBUILD_MICRO_VERSION += 1;
29dnl      SBUILD_INTERFACE_AGE += 1;
30dnl 2. if any functions have been added, removed, or changed, set
31dnl      SBUILD_INTERFACE_AGE = 0;
32dnl      SBUILD_CURRENT_INTERFACE += 1;
33dnl 3. if interfaces have been added, set
34dnl      SBUILD_BINARY_AGE += 1;
35dnl 4. if interfaces have been removed, set
36dnl      SBUILD_BINARY_AGE = 0;
37dnl
38dnl For more detailed information, see the libtool info documentation.
39dnl
40dnl m4 magic from Eric Blake <ebb9@byu.net>, prior to automake inclusion
41m4_define([sbuild_m4_chomp],
42[m4_format([[%.*s]], m4_bregexp(m4_translit([$1], [
43]]m4_dquote(_m4_defn([m4_cr_all]))[, [/]]m4_format([%255s], [])[),
44  [/*$]), [$1])])
45m4_define([sbuild_m4_esyscmd_s],
46[sbuild_m4_chomp(m4_esyscmd([$1]))])
47AC_PREREQ(2.59)
48dnl Quoting the first argument results in a bizarrely corrupted package tarname
49AC_INIT(sbuild_m4_esyscmd_s([sed -ne '/^Package:/{s/Package:[[:space:]][[:space:]]*//p;q}' VERSION]),
50        [sbuild_m4_esyscmd_s([sed -ne '/^Version:/{s/Version:[[:space:]][[:space:]]*//p;q}' VERSION])],
51        [buildd-tools-devel@lists.alioth.debian.org])
52pushdef([SBUILD_CURRENT_INTERFACE], [1])
53pushdef([SBUILD_INTERFACE_AGE],     [0])
54pushdef([SBUILD_BINARY_AGE],        [0])
55dnl For safety, check we are in the right directory by
56dnl checking for a known unique file.
57AC_CONFIG_SRCDIR([sbuild/sbuild-session.cc])
58dnl Place auxilliary scripts here.
59AC_CONFIG_AUX_DIR([scripts])
60dnl Add config headers.
61AC_CONFIG_HEADER([config.h])
62AC_CONFIG_HEADER([sbuild/sbuild-config.h])
63
64AC_COPYRIGHT(
65[
66Copyright © 2004-2009  Roger Leigh <rleigh@debian.org>
67
68Parts of this configure script come from the 'configure.ac' file, and
69are not based on freely-redistributable m4 macros; you can
70redistribute it and/or modify it under the terms of the GNU General
71Public License as published by the Free Software Foundation, either
72version 3 of the License, or (at your option) any later version.
73
74This software is distributed in the hope that it will be useful, but
75WITHOUT ANY WARRANTY; without even the implied warranty of
76MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
77General Public License for more details.
78
79You should have received a copy of the GNU General Public License
80along with this program.  If not, see <http://www.gnu.org/licenses/>.
81])
82
83[SBUILD_CURRENT_INTERFACE]=SBUILD_CURRENT_INTERFACE
84[SBUILD_INTERFACE_AGE]=SBUILD_INTERFACE_AGE
85[SBUILD_BINARY_AGE]=SBUILD_BINARY_AGE
86popdef([SBUILD_CURRENT_INTERFACE])
87popdef([SBUILD_INTERFACE_AGE])
88popdef([SBUILD_BINARY_AGE])
89
90AC_SUBST([SBUILD_CURRENT_INTERFACE])
91AC_SUBST([SBUILD_INTERFACE_AGE])
92AC_SUBST([SBUILD_BINARY_AGE])
93
94dnl Initialise automake stuff.
95AM_INIT_AUTOMAKE([1.10 gnu check-news dist-bzip2 no-dist-gzip tar-pax])
96m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
97AM_MAINTAINER_MODE
98RELEASE_DATE='sbuild_m4_esyscmd_s(date --date='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])' '+%s')'
99RELEASE_DATE_S='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])'
100AC_DEFINE_UNQUOTED([RELEASE_DATE_S], ["$RELEASE_DATE_S"], [Package release date (string).])
101AC_DEFINE_UNQUOTED([RELEASE_DATE], [$RELEASE_DATE], [Package release date (integer).])
102AC_SUBST([RELEASE_DATE])
103AC_SUBST([RELEASE_DATE_S])
104
105AC_MSG_CHECKING([whether to enable dchroot compatibility])
106AC_ARG_ENABLE([dchroot], [AS_HELP_STRING([--enable-dchroot], [Enable dchroot compatibility])],
107              [ case "${enableval}" in
108                yes) enable_dchroot_compat="yes" ;;
109                no)  enable_dchroot_compat="no" ;;
110                *) AC_MSG_RESULT([unknown])
111                   AC_MSG_ERROR([bad value ${enableval} for --enable-dchroot]) ;;
112                esac ],
113              [ enable_dchroot_compat="no" ])
114AC_MSG_RESULT([$enable_dchroot_compat])
115AM_CONDITIONAL([BUILD_DCHROOT], [test "$enable_dchroot_compat" = "yes"])
116
117AC_MSG_CHECKING([whether to enable dchroot-dsa compatibility])
118AC_ARG_ENABLE([dchroot-dsa], [AS_HELP_STRING([--enable-dchroot-dsa], [Enable dchroot-dsa compatibility])],
119              [ case "${enableval}" in
120                yes) enable_dchroot_dsa_compat="yes" ;;
121                no)  enable_dchroot_dsa_compat="no" ;;
122                *) AC_MSG_RESULT([unknown])
123                   AC_MSG_ERROR([bad value ${enableval} for --enable-dchroot-dsa]) ;;
124                esac ],
125              [ enable_dchroot_dsa_compat="no" ])
126AC_MSG_RESULT([$enable_dchroot_dsa_compat])
127AM_CONDITIONAL([BUILD_DCHROOT_DSA], [test "$enable_dchroot_dsa_compat" = "yes"])
128AM_CONDITIONAL([BUILD_LIBDCHROOT], [test "$enable_dchroot_compat" = "yes" || test "$enable_dchroot_dsa_compat" = "yes"])
129
130AC_MSG_CHECKING([whether to enable csbuild])
131AC_ARG_ENABLE([csbuild], [AS_HELP_STRING([--enable-csbuild], [Enable csbuild])],
132              [ case "${enableval}" in
133                yes) enable_csbuild_compat="yes" ;;
134                no)  enable_csbuild_compat="no" ;;
135                *) AC_MSG_RESULT([unknown])
136                   AC_MSG_ERROR([bad value ${enableval} for --enable-csbuild]) ;;
137                esac ],
138              [ enable_csbuild_compat="no" ])
139
140AC_MSG_RESULT([$enable_csbuild_compat])
141AM_CONDITIONAL([BUILD_CSBUILD], [test "$enable_csbuild_compat" = "yes"])
142
143AC_MSG_CHECKING([whether to enable debugging messages])
144AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Enable debugging messages])],
145              [ case "${enableval}" in
146                yes) enable_debug="yes" ;;
147                no)  enable_debug="no" ;;
148                *) AC_MSG_RESULT([unknown])
149                   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
150                esac ],
151              [ enable_debug="no" ])
152AC_MSG_RESULT([$enable_debug])
153if test "$enable_debug" = "yes"; then
154  AC_DEFINE_UNQUOTED([SBUILD_DEBUG], [1], [Enable debugging])
155fi
156
157default_environment_filter='^(BASH_ENV|CDPATH|ENV|HOSTALIASES|IFS|KRB5_CONFIG|KRBCONFDIR|KRBTKFILE|KRB_CONF|LD_.*|LOCALDOMAIN|NLSPATH|PATH_LOCALE|RES_OPTIONS|TERMINFO|TERMINFO_DIRS|TERMPATH)$'
158
159AC_MSG_CHECKING([whether to enable environment filtering regex])
160AC_ARG_ENABLE([environment-filter], [AS_HELP_STRING([--enable-environment-filter], [Enable default environment filtering (regex)])],
161              [ case "${enableval}" in
162                yes) enable_environment_filter="$default_environment_filter" ;;
163                no)  enable_environment_filter="" ;;
164                *) enable_environment_filter="${enableval}" ;;
165                esac ],
166              [ enable_environment_filter="$default_environment_filter" ])
167AC_MSG_RESULT([$enable_environment_filter])
168AH_TEMPLATE(SBUILD_DEFAULT_ENVIRONMENT_FILTER, [Default regular expression used to filter user environment])
169AC_DEFINE_UNQUOTED([SBUILD_DEFAULT_ENVIRONMENT_FILTER], ["$enable_environment_filter"])
170
171AC_MSG_CHECKING([whether to enable support for PAM authentication])
172AC_ARG_ENABLE([pam], [AS_HELP_STRING([--enable-pam], [Enable support for PAM authentication (requires libpam)])],
173              [ case "${enableval}" in
174                yes) enable_pam="yes" ;;
175                no)  enable_pam="no" ;;
176                *) AC_MSG_RESULT([unknown])
177                   AC_MSG_ERROR([bad value ${enableval} for --enable-pam]) ;;
178                esac],
179              [enable_pam="auto"])
180AC_MSG_RESULT([$enable_pam])
181
182AC_MSG_CHECKING([whether to enable support for block devices])
183AC_ARG_ENABLE([block-device], [AS_HELP_STRING([--enable-block-device], [Enable support for block devices (requires liblockdev)])],
184              [ case "${enableval}" in
185                yes) enable_blockdev="yes" ;;
186                no)  enable_blockdev="no" ;;
187                *) AC_MSG_RESULT([unknown])
188                   AC_MSG_ERROR([bad value ${enableval} for --enable-blockdev]) ;;
189                esac],
190              [enable_blockdev="auto"])
191AC_MSG_RESULT([$enable_blockdev])
192
193AC_MSG_CHECKING([whether to enable support for LVM snapshots])
194AC_ARG_ENABLE([lvm-snapshot], [AS_HELP_STRING([--enable-lvm-snapshot], [Enable support for LVM snapshots (requires LVM and liblockdev)])],
195              [ case "${enableval}" in
196                yes) enable_lvmsnapshot="yes"
197                     enable_blockdev="yes" ;;
198                no)  enable_lvmsnapshot="no" ;;
199                *) AC_MSG_RESULT([unknown])
200                   AC_MSG_ERROR([bad value ${enableval} for --enable-lvm-snapshot]) ;;
201                esac],
202              [enable_lvmsnapshot="auto"])
203AC_MSG_RESULT([$enable_lvmsnapshot])
204
205AC_MSG_CHECKING([whether to enable support for loopback mounts])
206AC_ARG_ENABLE([loopback], [AS_HELP_STRING([--enable-loopback], [Enable support for loopback mounts])],
207              [ case "${enableval}" in
208                yes) enable_loopback="yes" ;;
209                no)  enable_loopback="no" ;;
210                *) AC_MSG_RESULT([unknown])
211                   AC_MSG_ERROR([bad value ${enableval} for --enable-loopback]) ;;
212                esac],
213              [enable_loopback="auto"])
214AC_MSG_RESULT([$enable_loopback])
215
216AC_MSG_CHECKING([whether to enable support for UUIDs in session names])
217AC_ARG_ENABLE([uuid], [AS_HELP_STRING([--enable-uuid], [Enable support for UUIDs])],
218              [ case "${enableval}" in
219                yes) enable_uuid="yes" ;;
220                no)  enable_uuid="no" ;;
221                *) AC_MSG_RESULT([unknown])
222                   AC_MSG_ERROR([bad value ${enableval} for --enable-uuid]) ;;
223                esac],
224              [enable_uuid="auto"])
225AC_MSG_RESULT([$enable_uuid])
226
227AC_MSG_CHECKING([whether to enable support for union mounts])
228AC_ARG_ENABLE([union], [AS_HELP_STRING([--enable-union], [Enable support for union mounts])],
229              [ case "${enableval}" in
230                yes) enable_union="yes" ;;
231                no)  enable_union="no" ;;
232                *) AC_MSG_RESULT([unknown])
233                   AC_MSG_ERROR([bad value ${enableval} for --enable-union]) ;;
234                esac],
235              [enable_union="auto"])
236AC_MSG_RESULT([$enable_union])
237
238AC_MSG_CHECKING([whether to enable doxygen documentation])
239AC_ARG_ENABLE([doxygen], [AS_HELP_STRING([--enable-doxygen], [Enable doxygen documentation])],
240              [ case "${enableval}" in
241                yes) enable_doxygen="yes" ;;
242                no)  enable_doxygen="no" ;;
243                *) AC_MSG_RESULT([unknown])
244                   AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;;
245                esac],
246              [ enable_doxygen="no" ])
247AC_MSG_RESULT([$enable_doxygen])
248AM_CONDITIONAL([BUILD_DOXYGEN], [test "$enable_doxygen" = "yes"])
249
250AC_MSG_CHECKING([for bash completion directory])
251bashcompletiondir='${sysconfdir}/bash_completion.d'
252AC_ARG_WITH([bash-completion-dir], [AS_HELP_STRING([--with-bash-completion-dir], [bash shell completion directory])],
253              [bashcompletiondir="${withval}"])
254AC_MSG_RESULT([$bashcompletiondir])
255AC_SUBST([bashcompletiondir])
256
257# Checks for programs.
258AC_PROG_CXX
259AC_LANG([C++])
260ACX_PTHREAD([], [AC_MSG_ERROR([POSIX thread support is required for correct std::tr1::shared_ptr operation])])
261AC_DISABLE_SHARED
262AC_ENABLE_STATIC
263AC_PROG_LIBTOOL
264AM_GNU_GETTEXT_VERSION([0.16])
265AM_GNU_GETTEXT([external])
266AC_PATH_PROG([FIND], [find])
267AC_PATH_PROG([XARGS], [xargs])
268AC_PATH_PROG([DOXYGEN], [doxygen])
269HAVE_LVM="yes"
270AC_PATH_PROG([LVCREATE], [lvcreate], [HAVE_LVM="no"], [$PATH:/sbin:/usr/sbin])
271AC_PATH_PROG([LVREMOVE], [lvremove], [HAVE_LVM="no"], [$PATH:/sbin:/usr/sbin])
272HAVE_LOOPBACK="yes"
273AC_PATH_PROG([LOSETUP], [losetup], [HAVE_LOOPBACK="no"], [$PATH:/sbin:/usr/sbin])
274
275if test "$enable_doxygen" = "yes" && test -z "$DOXYGEN"; then
276  AC_MSG_FAILURE([doxygen is not installed, but is required by schroot])
277fi;
278AM_CONDITIONAL([BUILD_DOXYGEN], [test -n "$DOXYGEN" && test "$enable_doxygen" = "yes"])
279
280# Checks for libraries.
281PKG_CHECK_MODULES([UUID], [uuid],
282                  [AC_DEFINE(HAVE_UUID)
283                   HAVE_UUID=yes],
284                  [HAVE_UUID=no])
285
286AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
287AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"])
288
289SCHROOT_CFLAGS="$UUID_CFLAGS"
290AC_SUBST([SCHROOT_CFLAGS])
291
292# Checks for header files.
293AC_CHECK_HEADERS([tr1/memory])
294
295AC_CHECK_HEADERS([boost/shared_ptr.hpp],, [
296  if test $ac_cv_header_tr1_memory = yes; then
297    :
298  else
299    AC_MSG_ERROR([Boost.shared_ptr (Boost C++ Libraries) is not installed, but is required by schroot])
300  fi])
301
302AC_CHECK_HEADERS([tr1/tuple])
303
304AC_CHECK_HEADERS([boost/tuple/tuple.hpp],, [
305  if test $ac_cv_header_tr1_memory = yes; then
306    :
307  else
308    AC_MSG_ERROR([Boost.Tuple (Boost C++ Libraries) is not installed, but is required by schroot])
309  fi])
310
311AC_CHECK_HEADERS([boost/format.hpp],, [AC_MSG_ERROR([Boost.Format (Boost C++ Libraries) is not installed, but is required by schroot])])
312AC_CHECK_HEADERS([boost/program_options.hpp],, [AC_MSG_ERROR([Boost.Program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
313AC_CHECK_HEADERS([boost/type_traits.hpp],, [AC_MSG_ERROR([Boost.TypeTraits (Boost C++ Libraries) is not installed, but is required by schroot])])
314
315AC_CHECK_HEADERS([ext/stdio_filebuf.h],, [AC_MSG_ERROR([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
316
317AC_CHECK_HEADERS([sys/personality.h],
318                 [PERSONALITY_HEADER="yes"],
319                 [PERSONALITY_HEADER="no"])
320
321AC_CHECK_HEADERS([security/pam_appl.h],
322                 [PAM_HEADER="yes"],
323                 [PAM_HEADER="no"])
324
325# Checks for typedefs, structures, and compiler characteristics.
326
327# Checks for library functions.
328AC_CHECK_LIB([pam], [pam_authenticate],
329             [PAM_LIBS="-lpam"
330              PAM_FUNC="yes"],
331             [PAM_LIBS=""
332              PAM_FUNC="no"])
333AC_SUBST([PAM_LIBS])
334
335AC_CHECK_LIB([lockdev], [dev_lock],
336             [LOCKDEV_LIBS="-llockdev"
337              HAVE_LOCKDEV="yes"],
338             [LOCKDEV_LIBS=""
339              HAVE_LOCKDEV="no"])
340AC_SUBST([LOCKDEV_LIBS])
341AH_TEMPLATE(SBUILD_FEATURE_DEVLOCK, [Set if the device locking with liblockdev is available])
342if test "$HAVE_LOCKDEV" = "yes"; then
343  AC_DEFINE(SBUILD_FEATURE_DEVLOCK, 1)
344fi
345
346AC_CHECK_FUNC([personality],
347              [PERSONALITY_FUNC="yes"],
348              [PERSONALITY_FUNC="no"])
349
350# Determine which features to enable.
351AC_MSG_CHECKING([whether to build personality support])
352BUILD_PERSONALITY="yes"
353if test "$PERSONALITY_HEADER" = "no"; then
354  BUILD_PERSONALITY="no"
355fi
356if test "$PERSONALITY_FUNC" = "no"; then
357  BUILD_PERSONALITY="no"
358fi
359AC_MSG_RESULT([$BUILD_PERSONALITY])
360
361AM_CONDITIONAL([BUILD_PERSONALITY], [test "$BUILD_PERSONALITY" = "yes"])
362AH_TEMPLATE(SBUILD_FEATURE_PERSONALITY, [Set if personality support is present])
363if test "$BUILD_PERSONALITY" = "yes"; then
364  AC_DEFINE(SBUILD_FEATURE_PERSONALITY, 1)
365fi
366
367AC_MSG_CHECKING([whether to build UUID support])
368BUILD_UUID="yes"
369if test "$enable_uuid" = "yes"; then
370  BUILD_UUID="no"
371fi
372if test "$HAVE_UUID" = "no"; then
373  BUILD_UUID="no"
374fi
375AC_MSG_RESULT([$BUILD_UUID])
376
377AH_TEMPLATE(HAVE_UUID, [Set if UUID support is available])
378if test "$BUILD_UUID" = "yes"; then
379  AC_DEFINE(HAVE_UUID, 1)
380fi
381
382AC_MSG_CHECKING([whether to build PAM support])
383BUILD_PAM="yes"
384if test "$enable_pam" = "yes"; then
385  if test "$PAM_HEADER" = "no"; then
386    BUILD_PAM="no"
387    AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])
388  fi
389  if test "$PAM_FUNC" = "no"; then
390    BUILD_PAM="no"
391    AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])
392  fi
393elif test "$enable_pam" = "no"; then
394    BUILD_PAM="no"
395elif test "$enable_pam" = "auto"; then
396  if test "$PAM_HEADER" = "no"; then
397    BUILD_PAM="no"
398  fi
399  if test "$PAM_FUNC" = "no"; then
400    BUILD_PAM="no"
401  fi
402fi
403AC_MSG_RESULT([$BUILD_PAM])
404
405AM_CONDITIONAL([BUILD_PAM], [test "$BUILD_PAM" = "yes"])
406AH_TEMPLATE(SBUILD_FEATURE_PAM, [Set if PAM support is available])
407if test "$BUILD_PAM" = "yes"; then
408  AC_DEFINE(SBUILD_FEATURE_PAM, 1)
409fi
410
411AC_MSG_CHECKING([whether to build block-device support])
412BUILD_BLOCKDEV="yes"
413if test "$enable_blockdev" = "yes"; then
414  if test "$HAVE_LOCKDEV" = "no"; then
415    BUILD_BLOCKDEV="no"
416    AC_MSG_FAILURE([liblockdev (lockdev) is not installed, but is required by schroot])
417  fi
418elif test "$enable_blockdev" = "no"; then
419    BUILD_BLOCKDEV="no"
420elif test "$enable_blockdev" = "auto"; then
421  if test "$HAVE_LOCKDEV" = "no"; then
422    BUILD_BLOCKDEV="no"
423  fi
424fi
425AC_MSG_RESULT([$BUILD_BLOCKDEV])
426
427AM_CONDITIONAL([BUILD_BLOCKDEV], [test "$BUILD_BLOCKDEV" = "yes"])
428AH_TEMPLATE(SBUILD_FEATURE_BLOCKDEV, [Set if the block-device chroot type is present])
429if test "$BUILD_BLOCKDEV" = "yes"; then
430  AC_DEFINE(SBUILD_FEATURE_BLOCKDEV, 1)
431fi
432
433AC_MSG_CHECKING([whether to build lvm-snapshot support])
434BUILD_LVMSNAP="yes"
435if test "$enable_lvmsnapshot" = "yes"; then
436  if test "$HAVE_LVM" = "no"; then
437    BUILD_LVMSNAP="no"
438    AC_MSG_FAILURE([LVM (lvm) is not installed, but is required by schroot])
439  fi
440elif test "$enable_lvmsnapshot" = "no"; then
441    BUILD_LVMSNAP="no"
442elif test "$enable_lvmsnapshot" = "auto"; then
443  if test "$HAVE_LOCKDEV" = "no"; then
444    BUILD_LVMSNAP="no"
445  fi
446  if test "$HAVE_LVM" = "no"; then
447    BUILD_LVMSNAP="no"
448  fi
449fi
450AC_MSG_RESULT([$BUILD_LVMSNAP])
451
452AM_CONDITIONAL([BUILD_LVMSNAP], [test "$BUILD_LVMSNAP" = "yes"])
453AH_TEMPLATE(SBUILD_FEATURE_LVMSNAP, [Set if the lvm-snapshot chroot type is present])
454if test "$BUILD_LVMSNAP" = "yes"; then
455  AC_DEFINE(SBUILD_FEATURE_LVMSNAP, 1)
456fi
457
458AC_MSG_CHECKING([whether to build loopback support])
459BUILD_LOOPBACK="yes"
460if test "$enable_loopbackshot" = "yes"; then
461  if test "$HAVE_LOOPBACK" = "no"; then
462    BUILD_LOOPBACK="no"
463    AC_MSG_FAILURE([Loopback support is not avilable, but is required by schroot])
464  fi
465elif test "$enable_loopbackshot" = "no"; then
466    BUILD_LOOPBACK="no"
467elif test "$enable_loopbackshot" = "auto"; then
468  if test "$HAVE_LOOPBACK" = "no"; then
469    BUILD_LOOPBACK="no"
470  fi
471fi
472AC_MSG_RESULT([$BUILD_LOOPBACK])
473
474AM_CONDITIONAL([BUILD_LOOPBACK], [test "$BUILD_LOOPBACK" = "yes"])
475AH_TEMPLATE(SBUILD_FEATURE_LOOPBACK, [Set if the loopback chroot type is present])
476if test "$BUILD_LOOPBACK" = "yes"; then
477  AC_DEFINE(SBUILD_FEATURE_LOOPBACK, 1)
478fi
479
480AC_MSG_CHECKING([whether to build union support])
481BUILD_UNION="yes"
482if test "$enable_union" = "yes"; then
483  :
484elif test "$enable_union" = "no"; then
485  BUILD_UNION="no"
486elif test "$enable_union" = "auto"; then
487  BUILD_UNION="yes"
488fi
489AC_MSG_RESULT([$BUILD_UNION])
490
491AM_CONDITIONAL([BUILD_UNION], [test "$BUILD_UNION" = "yes"])
492AH_TEMPLATE(SBUILD_FEATURE_UNION, [Set if the union filesystem type is present])
493if test "$BUILD_UNION" = "yes"; then
494  AC_DEFINE(SBUILD_FEATURE_UNION, 1)
495fi
496
497AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options])
498saved_LIBS="${LIBS}"
499LIBS="${LIBS} -lboost_program_options"
500AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
501                               [boost::program_options::variables_map::variables_map dummy()])],
502               [AC_MSG_RESULT([yes])
503                BOOST_LIBS="${BOOST_LIBS} -lboost_program_options"],
504               [AC_MSG_RESULT([no])
505                AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
506LIBS="${saved_LIBS}"
507
508AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options])
509saved_LIBS="${LIBS}"
510LIBS="${LIBS} -lboost_program_options"
511AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
512                               [boost::program_options::options_description testgrp("test group");
513                                bool notused = testgrp.options().empty();
514])],
515               [AC_MSG_RESULT([yes])
516                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
517               [AC_MSG_RESULT([no])
518                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"])
519LIBS="${saved_LIBS}"
520AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available])
521if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then
522  AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
523fi
524
525AC_MSG_CHECKING([for boost::regex in -lboost_regex])
526saved_LIBS="${LIBS}"
527LIBS="${LIBS} -lboost_regex"
528AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>],
529                               [boost::regex("^foo[bar]$")])],
530               [AC_MSG_RESULT([yes])
531                BOOST_LIBS="${BOOST_LIBS} -lboost_regex"],
532               [AC_MSG_RESULT([no])
533                AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])
534LIBS="${saved_LIBS}"
535
536AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem])
537saved_LIBS="${LIBS}"
538LIBS="${LIBS} -lboost_filesystem"
539AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
540                               [boost::filesystem::is_directory("/")])],
541               [AC_MSG_RESULT([yes])
542                BOOST_FILESYSTEM_LIBS="-lboost_filesystem"],
543               [AC_MSG_RESULT([no])
544                AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])])
545LIBS="${saved_LIBS}"
546
547AC_SUBST([BOOST_LIBS])
548AC_SUBST([BOOST_FILESYSTEM_LIBS])
549
550AC_MSG_CHECKING([for __gnu_cxx::stdio_filebuf in libstdc++])
551AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ext/stdio_filebuf.h>
552#include <unistd.h>],
553                                [__gnu_cxx::stdio_filebuf<char> fdbuf(STDOUT_FILENO, std::ios::out)])],
554               [AC_MSG_RESULT([yes])],
555               [AC_MSG_RESULT([no])
556                AC_MSG_FAILURE([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
557
558dnl Set PACKAGE_LOCALE_DIR in config.h
559AH_TEMPLATE(PACKAGE_LOCALE_DIR, [Package locale directory])
560if test "x${prefix}" = "xNONE"; then
561  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, ["${ac_default_prefix}/share/locale"])
562else
563  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, ["${prefix}/share/locale"])
564fi
565
566dnl Set PACKAGE_DATA_DIR in config.h.
567AH_TEMPLATE(PACKAGE_DATA_DIR, [Package data directory])
568if test "x${datadir}" = 'x${prefix}/share' || test "x${datadir}" = 'x${datarootdir}'; then
569  if test "x${prefix}" = "xNONE"; then
570    PACKAGE_DATA_DIR="${ac_default_prefix}/share/${PACKAGE}"
571  else
572    PACKAGE_DATA_DIR="${prefix}/share/${PACKAGE}"
573  fi
574else
575  PACKAGE_DATA_DIR="${datadir}/${PACKAGE}"
576fi
577
578AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${PACKAGE_DATA_DIR}")
579
580dnl Set PACKAGE_LIB_DIR in config.h.
581AH_TEMPLATE(PACKAGE_LIB_DIR, [Package lib directory])
582if test "x${libdir}" = 'x${exec_prefix}/lib'; then
583  if test "x${exec_prefix}" = "xNONE"; then
584    if test "x${prefix}" = "xNONE"; then
585      PACKAGE_LIB_DIR="${ac_default_prefix}/lib/${PACKAGE}"
586    else
587      PACKAGE_LIB_DIR="${prefix}/lib/${PACKAGE}"
588    fi
589  else
590    PACKAGE_LIB_DIR="${exec_prefix}/lib/${PACKAGE}"
591  fi
592else
593  PACKAGE_LIB_DIR="${libdir}/${PACKAGE}"
594fi
595
596dnl Set PACKAGE_LIBEXEC_DIR in config.h.
597AH_TEMPLATE(PACKAGE_LIBEXEC_DIR, [Package libexec directory])
598if test "x${libexecdir}" = 'x${exec_prefix}/libexec'; then
599  if test "x${exec_prefix}" = "xNONE"; then
600    if test "x${prefix}" = "xNONE"; then
601      PACKAGE_LIBEXEC_DIR="${ac_default_prefix}/libexec/${PACKAGE}"
602    else
603      PACKAGE_LIBEXEC_DIR="${prefix}/libexec/${PACKAGE}"
604    fi
605  else
606    PACKAGE_LIBEXEC_DIR="${exec_prefix}/libexec/${PACKAGE}"
607  fi
608else
609  PACKAGE_LIBEXEC_DIR="${libexecdir}/${PACKAGE}"
610fi
611
612SCHROOT_LIBEXEC_DIR="${PACKAGE_LIBEXEC_DIR}"
613AC_SUBST(SCHROOT_LIBEXEC_DIR)
614AH_TEMPLATE(SCHROOT_LIBEXEC_DIR, [Package libexec directory])
615AC_DEFINE_UNQUOTED(SCHROOT_LIBEXEC_DIR, ["$SCHROOT_LIBEXEC_DIR"])
616
617dnl Set PACKAGE_LOCALSTATE_DIR in config.h.
618AH_TEMPLATE(PACKAGE_LOCALSTATE_DIR, [Package localstate directory])
619if test "x${localstatedir}" = 'x${prefix}/var'; then
620  if test "x${prefix}" = "xNONE"; then
621    if test "x${prefix}" = "xNONE"; then
622      PACKAGE_LOCALSTATE_DIR="${ac_default_prefix}/var"
623    else
624      PACKAGE_LOCALSTATE_DIR="${prefix}/var"
625    fi
626  else
627    PACKAGE_LOCALSTATE_DIR="${prefix}/var"
628  fi
629else
630  PACKAGE_LOCALSTATE_DIR="${localstatedir}"
631fi
632
633SCHROOT_MOUNT_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/mount"
634AC_SUBST([SCHROOT_MOUNT_DIR])
635AH_TEMPLATE(SCHROOT_MOUNT_DIR, [schroot mount directory])
636AC_DEFINE_UNQUOTED(SCHROOT_MOUNT_DIR, ["$SCHROOT_MOUNT_DIR"])
637
638SCHROOT_SESSION_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/session"
639AC_SUBST([SCHROOT_SESSION_DIR])
640AH_TEMPLATE(SCHROOT_SESSION_DIR, [schroot session directory])
641AC_DEFINE_UNQUOTED(SCHROOT_SESSION_DIR, ["$SCHROOT_SESSION_DIR"])
642
643SCHROOT_FILE_UNPACK_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/unpack"
644AC_SUBST([SCHROOT_FILE_UNPACK_DIR])
645AH_TEMPLATE(SCHROOT_FILE_UNPACK_DIR, [schroot file unpack directory])
646AC_DEFINE_UNQUOTED(SCHROOT_FILE_UNPACK_DIR, ["$SCHROOT_FILE_UNPACK_DIR"])
647
648SCHROOT_OVERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/overlay"
649AC_SUBST([SCHROOT_OVERLAY_DIR])
650AH_TEMPLATE(SCHROOT_OVERLAY_DIR, [schroot overlay directory])
651AC_DEFINE_UNQUOTED(SCHROOT_OVERLAY_DIR, ["$SCHROOT_OVERLAY_DIR"])
652
653SCHROOT_UNDERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/underlay"
654AC_SUBST([SCHROOT_UNDERLAY_DIR])
655AH_TEMPLATE(SCHROOT_UNDERLAY_DIR, [schroot underlay directory])
656AC_DEFINE_UNQUOTED(SCHROOT_UNDERLAY_DIR, ["$SCHROOT_UNDERLAY_DIR"])
657
658dnl Set PACKAGE_SYSCONF_DIR in config.h.
659AH_TEMPLATE(PACKAGE_SYSCONF_DIR, [Package system configuration directory])
660if test "x${sysconfdir}" = 'x${prefix}/etc'; then
661  if test "x${prefix}" = "xNONE"; then
662    PACKAGE_SYSCONF_DIR="${ac_default_prefix}/etc"
663  else
664    PACKAGE_SYSCONF_DIR="${prefix}/etc"
665  fi
666else
667  PACKAGE_SYSCONF_DIR="${sysconfdir}"
668fi
669PACKAGE_SYSCONF_DIR="${PACKAGE_SYSCONF_DIR}/schroot"
670AC_DEFINE_UNQUOTED([PACKAGE_SYSCONF_DIR], ["$PACKAGE_SYSCONF_DIR"])
671AC_SUBST([PACKAGE_SYSCONF_DIR])
672
673SCHROOT_CONF="${PACKAGE_SYSCONF_DIR}/schroot.conf"
674AC_SUBST([SCHROOT_CONF])
675
676AH_TEMPLATE(SCHROOT_CONF, [schroot config file path])
677AC_DEFINE_UNQUOTED(SCHROOT_CONF, ["$SCHROOT_CONF"])
678
679SCHROOT_CONF_CHROOT_D="${PACKAGE_SYSCONF_DIR}/chroot.d"
680AC_SUBST([SCHROOT_CONF_CHROOT_D])
681
682AH_TEMPLATE(SCHROOT_CONF_CHROOT_D, [schroot chroot directory])
683AC_DEFINE_UNQUOTED(SCHROOT_CONF_CHROOT_D, ["$SCHROOT_CONF_CHROOT_D"])
684
685SCHROOT_CONF_SETUP_D="${PACKAGE_SYSCONF_DIR}/setup.d"
686AC_SUBST([SCHROOT_CONF_SETUP_D])
687
688AH_TEMPLATE(SCHROOT_CONF_SETUP_D, [schroot chroot setup directory])
689AC_DEFINE_UNQUOTED(SCHROOT_CONF_SETUP_D, ["$SCHROOT_CONF_SETUP_D"])
690
691AH_TEMPLATE(SCHROOT_DATADIR, [Package data directory])
692SCHROOT_DATADIR="${PACKAGE_DATA_DIR}/${PACKAGE_VERSION}"
693AC_DEFINE_UNQUOTED(SCHROOT_DATADIR, ["$SCHROOT_DATADIR"])
694
695AH_TEMPLATE(SCHROOT_MODULEDIR, [Package module directory])
696SCHROOT_MODULEDIR="${PACKAGE_LIB_DIR}/${PACKAGE_VERSION}/modules"
697AC_DEFINE_UNQUOTED(SCHROOT_MODULEDIR, ["$SCHROOT_MODULEDIR"])
698
699if test "x${sysconfdir}" = 'x${prefix}/etc'; then
700  if test "x${prefix}" = "xNONE"; then
701    DCHROOT_SYSCONF_DIR="${ac_default_prefix}/etc"
702  else
703    DCHROOT_SYSCONF_DIR="${prefix}/etc"
704  fi
705else
706  DCHROOT_SYSCONF_DIR="${sysconfdir}"
707fi
708
709DCHROOT_CONF="${DCHROOT_SYSCONF_DIR}/dchroot.conf"
710AC_SUBST([DCHROOT_CONF])
711
712AH_TEMPLATE(DCHROOT_CONF, [dchroot config file path])
713AC_DEFINE_UNQUOTED(DCHROOT_CONF, ["$DCHROOT_CONF"])
714
715CSBUILD_CONF="${CSBUILD_SYSCONF_DIR}/csbuild.conf"
716AC_SUBST([CSBUILD_CONF])
717
718AH_TEMPLATE(CSBUILD_CONF, [csbuild config file path])
719AC_DEFINE_UNQUOTED(CSBUILD_CONF, ["$CSBUILD_CONF"])
720
721dnl Configure which files to generate.
722AC_CONFIG_FILES([doc/Makefile])
723AC_CONFIG_FILES([doc/sbuild.dox])
724AC_CONFIG_FILES([doc/schroot.dox])
725AC_CONFIG_FILES([po/Makefile.in])
726AC_CONFIG_FILES([sbuild/Makefile])
727AC_CONFIG_FILES([sbuild/sbuild.pc])
728AC_CONFIG_FILES([bin/Makefile])
729AC_CONFIG_FILES([bin/schroot-base/Makefile])
730AC_CONFIG_FILES([bin/schroot/Makefile])
731AC_CONFIG_FILES([bin/schroot-listmounts/Makefile])
732AC_CONFIG_FILES([bin/schroot-mount/Makefile])
733AC_CONFIG_FILES([bin/schroot-releaselock/Makefile])
734AC_CONFIG_FILES([bin/dchroot/Makefile])
735AC_CONFIG_FILES([bin/dchroot-dsa/Makefile])
736AC_CONFIG_FILES([bin/csbuild/Makefile])
737AC_CONFIG_FILES([etc/Makefile])
738AC_CONFIG_FILES([etc/pam/Makefile])
739AC_CONFIG_FILES([etc/setup.d/Makefile])
740AC_CONFIG_FILES([etc/bash_completion/Makefile])
741AC_CONFIG_FILES([man/Makefile])
742AC_CONFIG_FILES([man/schroot.1])
743AC_CONFIG_FILES([man/schroot-setup.5])
744AC_CONFIG_FILES([man/schroot.conf.5])
745AC_CONFIG_FILES([man/schroot-script-config.5])
746AC_CONFIG_FILES([man/dchroot.1])
747AC_CONFIG_FILES([man/dchroot-dsa.1])
748AC_CONFIG_FILES([man/csbuild.1])
749AC_CONFIG_FILES([scripts/po-notify])
750AC_CONFIG_FILES([test/Makefile])
751AC_CONFIG_FILES([Makefile])
752dnl Output the generated config.status script.
753AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.