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

Revision 24314, 29.8 KB checked in by geofft, 15 years ago (diff)
In schroot: * Merge with Debian unstable; remaining changes: - Backport to Karmic, and adjust build-deps.
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="${saved_LIBS} -lboost_program_options"
500define([testprog], [AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
501                                   [boost::program_options::variables_map::variables_map dummy()])])
502AC_LINK_IFELSE(testprog,
503               [AC_MSG_RESULT([yes])
504                BOOST_LIBS="${BOOST_LIBS} -lboost_program_options"],
505LIBS="${saved_LIBS} -lboost_program_options-mt"
506[AC_LINK_IFELSE(testprog,
507               [AC_MSG_RESULT([yes])
508                BOOST_LIBS="${BOOST_LIBS} -lboost_program_options-mt"],
509               [AC_MSG_RESULT([no])
510                AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])])
511LIBS="${saved_LIBS}"
512
513AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options])
514saved_LIBS="${LIBS}"
515LIBS="${saved_LIBS} -lboost_program_options"
516define([testprog], [AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
517                                   [boost::program_options::options_description testgrp("test group");
518                                    bool notused = testgrp.options().empty();
519])])
520AC_LINK_IFELSE(testprog,
521               [AC_MSG_RESULT([yes])
522                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
523LIBS="${saved_LIBS} -lboost_program_options"
524[AC_LINK_IFELSE(testprog,
525               [AC_MSG_RESULT([yes])
526                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
527               [AC_MSG_RESULT([no])
528                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"])])
529LIBS="${saved_LIBS}"
530AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available])
531if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then
532  AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
533fi
534
535AC_MSG_CHECKING([for boost::regex in -lboost_regex])
536saved_LIBS="${LIBS}"
537LIBS="${saved_LIBS} -lboost_regex"
538define([testprog], [AC_LANG_PROGRAM([#include <boost/regex.hpp>],
539                                   [boost::regex("^foo[bar]$")])])
540AC_LINK_IFELSE(testprog,
541               [AC_MSG_RESULT([yes])
542                BOOST_LIBS="${BOOST_LIBS} -lboost_regex"],
543LIBS="${saved_LIBS} -lboost_regex-mt"
544[AC_LINK_IFELSE(testprog,
545               [AC_MSG_RESULT([yes])
546                BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"],
547               [AC_MSG_RESULT([no])
548                AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])])
549LIBS="${saved_LIBS}"
550
551AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem])
552saved_LIBS="${LIBS}"
553LIBS="${saved_LIBS} -lboost_filesystem"
554define([testprog], [AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
555                                   [boost::filesystem::is_directory("/")])])
556AC_LINK_IFELSE(testprog,
557               [AC_MSG_RESULT([yes])
558                BOOST_FILESYSTEM_LIBS="-lboost_filesystem"],
559LIBS="${saved_LIBS} -lboost_filesystem-mt"
560[AC_LINK_IFELSE(testprog,
561               [AC_MSG_RESULT([yes])
562                BOOST_FILESYSTEM_LIBS="-lboost_filesystem-mt"],
563               [AC_MSG_RESULT([no])
564                AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])])])
565LIBS="${saved_LIBS}"
566
567AC_SUBST([BOOST_LIBS])
568AC_SUBST([BOOST_FILESYSTEM_LIBS])
569
570AC_MSG_CHECKING([for __gnu_cxx::stdio_filebuf in libstdc++])
571AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ext/stdio_filebuf.h>
572#include <unistd.h>],
573                                [__gnu_cxx::stdio_filebuf<char> fdbuf(STDOUT_FILENO, std::ios::out)])],
574               [AC_MSG_RESULT([yes])],
575               [AC_MSG_RESULT([no])
576                AC_MSG_FAILURE([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
577
578dnl Set PACKAGE_LOCALE_DIR in config.h
579AH_TEMPLATE(PACKAGE_LOCALE_DIR, [Package locale directory])
580if test "x${prefix}" = "xNONE"; then
581  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, ["${ac_default_prefix}/share/locale"])
582else
583  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, ["${prefix}/share/locale"])
584fi
585
586dnl Set PACKAGE_DATA_DIR in config.h.
587AH_TEMPLATE(PACKAGE_DATA_DIR, [Package data directory])
588if test "x${datadir}" = 'x${prefix}/share' || test "x${datadir}" = 'x${datarootdir}'; then
589  if test "x${prefix}" = "xNONE"; then
590    PACKAGE_DATA_DIR="${ac_default_prefix}/share/${PACKAGE}"
591  else
592    PACKAGE_DATA_DIR="${prefix}/share/${PACKAGE}"
593  fi
594else
595  PACKAGE_DATA_DIR="${datadir}/${PACKAGE}"
596fi
597
598AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${PACKAGE_DATA_DIR}")
599
600dnl Set PACKAGE_LIB_DIR in config.h.
601AH_TEMPLATE(PACKAGE_LIB_DIR, [Package lib directory])
602if test "x${libdir}" = 'x${exec_prefix}/lib'; then
603  if test "x${exec_prefix}" = "xNONE"; then
604    if test "x${prefix}" = "xNONE"; then
605      PACKAGE_LIB_DIR="${ac_default_prefix}/lib/${PACKAGE}"
606    else
607      PACKAGE_LIB_DIR="${prefix}/lib/${PACKAGE}"
608    fi
609  else
610    PACKAGE_LIB_DIR="${exec_prefix}/lib/${PACKAGE}"
611  fi
612else
613  PACKAGE_LIB_DIR="${libdir}/${PACKAGE}"
614fi
615
616dnl Set PACKAGE_LIBEXEC_DIR in config.h.
617AH_TEMPLATE(PACKAGE_LIBEXEC_DIR, [Package libexec directory])
618if test "x${libexecdir}" = 'x${exec_prefix}/libexec'; then
619  if test "x${exec_prefix}" = "xNONE"; then
620    if test "x${prefix}" = "xNONE"; then
621      PACKAGE_LIBEXEC_DIR="${ac_default_prefix}/libexec/${PACKAGE}"
622    else
623      PACKAGE_LIBEXEC_DIR="${prefix}/libexec/${PACKAGE}"
624    fi
625  else
626    PACKAGE_LIBEXEC_DIR="${exec_prefix}/libexec/${PACKAGE}"
627  fi
628else
629  PACKAGE_LIBEXEC_DIR="${libexecdir}/${PACKAGE}"
630fi
631
632SCHROOT_LIBEXEC_DIR="${PACKAGE_LIBEXEC_DIR}"
633AC_SUBST(SCHROOT_LIBEXEC_DIR)
634AH_TEMPLATE(SCHROOT_LIBEXEC_DIR, [Package libexec directory])
635AC_DEFINE_UNQUOTED(SCHROOT_LIBEXEC_DIR, ["$SCHROOT_LIBEXEC_DIR"])
636
637dnl Set PACKAGE_LOCALSTATE_DIR in config.h.
638AH_TEMPLATE(PACKAGE_LOCALSTATE_DIR, [Package localstate directory])
639if test "x${localstatedir}" = 'x${prefix}/var'; then
640  if test "x${prefix}" = "xNONE"; then
641    if test "x${prefix}" = "xNONE"; then
642      PACKAGE_LOCALSTATE_DIR="${ac_default_prefix}/var"
643    else
644      PACKAGE_LOCALSTATE_DIR="${prefix}/var"
645    fi
646  else
647    PACKAGE_LOCALSTATE_DIR="${prefix}/var"
648  fi
649else
650  PACKAGE_LOCALSTATE_DIR="${localstatedir}"
651fi
652
653SCHROOT_MOUNT_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/mount"
654AC_SUBST([SCHROOT_MOUNT_DIR])
655AH_TEMPLATE(SCHROOT_MOUNT_DIR, [schroot mount directory])
656AC_DEFINE_UNQUOTED(SCHROOT_MOUNT_DIR, ["$SCHROOT_MOUNT_DIR"])
657
658SCHROOT_SESSION_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/session"
659AC_SUBST([SCHROOT_SESSION_DIR])
660AH_TEMPLATE(SCHROOT_SESSION_DIR, [schroot session directory])
661AC_DEFINE_UNQUOTED(SCHROOT_SESSION_DIR, ["$SCHROOT_SESSION_DIR"])
662
663SCHROOT_FILE_UNPACK_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/unpack"
664AC_SUBST([SCHROOT_FILE_UNPACK_DIR])
665AH_TEMPLATE(SCHROOT_FILE_UNPACK_DIR, [schroot file unpack directory])
666AC_DEFINE_UNQUOTED(SCHROOT_FILE_UNPACK_DIR, ["$SCHROOT_FILE_UNPACK_DIR"])
667
668SCHROOT_OVERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/overlay"
669AC_SUBST([SCHROOT_OVERLAY_DIR])
670AH_TEMPLATE(SCHROOT_OVERLAY_DIR, [schroot overlay directory])
671AC_DEFINE_UNQUOTED(SCHROOT_OVERLAY_DIR, ["$SCHROOT_OVERLAY_DIR"])
672
673SCHROOT_UNDERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/underlay"
674AC_SUBST([SCHROOT_UNDERLAY_DIR])
675AH_TEMPLATE(SCHROOT_UNDERLAY_DIR, [schroot underlay directory])
676AC_DEFINE_UNQUOTED(SCHROOT_UNDERLAY_DIR, ["$SCHROOT_UNDERLAY_DIR"])
677
678dnl Set PACKAGE_SYSCONF_DIR in config.h.
679AH_TEMPLATE(PACKAGE_SYSCONF_DIR, [Package system configuration directory])
680if test "x${sysconfdir}" = 'x${prefix}/etc'; then
681  if test "x${prefix}" = "xNONE"; then
682    PACKAGE_SYSCONF_DIR="${ac_default_prefix}/etc"
683  else
684    PACKAGE_SYSCONF_DIR="${prefix}/etc"
685  fi
686else
687  PACKAGE_SYSCONF_DIR="${sysconfdir}"
688fi
689PACKAGE_SYSCONF_DIR="${PACKAGE_SYSCONF_DIR}/schroot"
690AC_DEFINE_UNQUOTED([PACKAGE_SYSCONF_DIR], ["$PACKAGE_SYSCONF_DIR"])
691AC_SUBST([PACKAGE_SYSCONF_DIR])
692
693SCHROOT_CONF="${PACKAGE_SYSCONF_DIR}/schroot.conf"
694AC_SUBST([SCHROOT_CONF])
695
696AH_TEMPLATE(SCHROOT_CONF, [schroot config file path])
697AC_DEFINE_UNQUOTED(SCHROOT_CONF, ["$SCHROOT_CONF"])
698
699SCHROOT_CONF_CHROOT_D="${PACKAGE_SYSCONF_DIR}/chroot.d"
700AC_SUBST([SCHROOT_CONF_CHROOT_D])
701
702AH_TEMPLATE(SCHROOT_CONF_CHROOT_D, [schroot chroot directory])
703AC_DEFINE_UNQUOTED(SCHROOT_CONF_CHROOT_D, ["$SCHROOT_CONF_CHROOT_D"])
704
705SCHROOT_CONF_SETUP_D="${PACKAGE_SYSCONF_DIR}/setup.d"
706AC_SUBST([SCHROOT_CONF_SETUP_D])
707
708AH_TEMPLATE(SCHROOT_CONF_SETUP_D, [schroot chroot setup directory])
709AC_DEFINE_UNQUOTED(SCHROOT_CONF_SETUP_D, ["$SCHROOT_CONF_SETUP_D"])
710
711AH_TEMPLATE(SCHROOT_DATADIR, [Package data directory])
712SCHROOT_DATADIR="${PACKAGE_DATA_DIR}/${PACKAGE_VERSION}"
713AC_DEFINE_UNQUOTED(SCHROOT_DATADIR, ["$SCHROOT_DATADIR"])
714
715AH_TEMPLATE(SCHROOT_MODULEDIR, [Package module directory])
716SCHROOT_MODULEDIR="${PACKAGE_LIB_DIR}/${PACKAGE_VERSION}/modules"
717AC_DEFINE_UNQUOTED(SCHROOT_MODULEDIR, ["$SCHROOT_MODULEDIR"])
718
719if test "x${sysconfdir}" = 'x${prefix}/etc'; then
720  if test "x${prefix}" = "xNONE"; then
721    DCHROOT_SYSCONF_DIR="${ac_default_prefix}/etc"
722  else
723    DCHROOT_SYSCONF_DIR="${prefix}/etc"
724  fi
725else
726  DCHROOT_SYSCONF_DIR="${sysconfdir}"
727fi
728
729DCHROOT_CONF="${DCHROOT_SYSCONF_DIR}/dchroot.conf"
730AC_SUBST([DCHROOT_CONF])
731
732AH_TEMPLATE(DCHROOT_CONF, [dchroot config file path])
733AC_DEFINE_UNQUOTED(DCHROOT_CONF, ["$DCHROOT_CONF"])
734
735CSBUILD_CONF="${CSBUILD_SYSCONF_DIR}/csbuild.conf"
736AC_SUBST([CSBUILD_CONF])
737
738AH_TEMPLATE(CSBUILD_CONF, [csbuild config file path])
739AC_DEFINE_UNQUOTED(CSBUILD_CONF, ["$CSBUILD_CONF"])
740
741dnl Configure which files to generate.
742AC_CONFIG_FILES([doc/Makefile])
743AC_CONFIG_FILES([doc/sbuild.dox])
744AC_CONFIG_FILES([doc/schroot.dox])
745AC_CONFIG_FILES([po/Makefile.in])
746AC_CONFIG_FILES([sbuild/Makefile])
747AC_CONFIG_FILES([sbuild/sbuild.pc])
748AC_CONFIG_FILES([bin/Makefile])
749AC_CONFIG_FILES([bin/schroot-base/Makefile])
750AC_CONFIG_FILES([bin/schroot/Makefile])
751AC_CONFIG_FILES([bin/schroot-listmounts/Makefile])
752AC_CONFIG_FILES([bin/schroot-mount/Makefile])
753AC_CONFIG_FILES([bin/schroot-releaselock/Makefile])
754AC_CONFIG_FILES([bin/dchroot/Makefile])
755AC_CONFIG_FILES([bin/dchroot-dsa/Makefile])
756AC_CONFIG_FILES([bin/csbuild/Makefile])
757AC_CONFIG_FILES([etc/Makefile])
758AC_CONFIG_FILES([etc/pam/Makefile])
759AC_CONFIG_FILES([etc/setup.d/Makefile])
760AC_CONFIG_FILES([etc/bash_completion/Makefile])
761AC_CONFIG_FILES([man/Makefile])
762AC_CONFIG_FILES([man/schroot.1])
763AC_CONFIG_FILES([man/schroot-setup.5])
764AC_CONFIG_FILES([man/schroot.conf.5])
765AC_CONFIG_FILES([man/schroot-script-config.5])
766AC_CONFIG_FILES([man/dchroot.1])
767AC_CONFIG_FILES([man/dchroot-dsa.1])
768AC_CONFIG_FILES([man/csbuild.1])
769AC_CONFIG_FILES([scripts/po-notify])
770AC_CONFIG_FILES([test/Makefile])
771AC_CONFIG_FILES([Makefile])
772dnl Output the generated config.status script.
773AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.