~ubuntu-branches/ubuntu/trusty/schroot/trusty

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh
  • Date: 2009-11-07 10:46:54 UTC
  • mfrom: (1.1.20 upstream) (2.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20091107104654-kk1fp1icv8dzfyfi
* New upstream development release.
* schroot:
  - Return success when ending a session and the operation
    succeeded (Closes: #554907).

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
dnl
38
38
dnl For more detailed information, see the libtool info documentation.
39
39
dnl
40
 
pushdef([SBUILD_NAME],              [schroot])
41
 
pushdef([SBUILD_MAJOR_VERSION],     [1])
42
 
pushdef([SBUILD_MINOR_VERSION],     [2])
43
 
pushdef([SBUILD_MICRO_VERSION],     [3])
44
 
pushdef([SBUILD_EXTRA_VERSION],     [])
 
40
dnl m4 magic from Eric Blake <ebb9@byu.net>, prior to automake inclusion
 
41
m4_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])])
 
45
m4_define([sbuild_m4_esyscmd_s],
 
46
[sbuild_m4_chomp(m4_esyscmd([$1]))])
 
47
AC_PREREQ(2.59)
 
48
dnl Quoting the first argument results in a bizarrely corrupted package tarname
 
49
AC_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])
45
52
pushdef([SBUILD_CURRENT_INTERFACE], [1])
46
53
pushdef([SBUILD_INTERFACE_AGE],     [0])
47
54
pushdef([SBUILD_BINARY_AGE],        [0])
48
 
pushdef([SBUILD_VERSION], SBUILD_MAJOR_VERSION.SBUILD_MINOR_VERSION.SBUILD_MICRO_VERSION[]SBUILD_EXTRA_VERSION)
49
 
dnl
50
 
dnl The minimum version of autoconf required.
51
 
AC_PREREQ(2.59)
52
 
dnl Initialise autoconf with the package name, version and
53
 
dnl bug-reporting address.
54
 
AC_INIT(SBUILD_NAME, SBUILD_VERSION, [buildd-tools-devel@lists.alioth.debian.org])
55
55
dnl For safety, check we are in the right directory by
56
56
dnl checking for a known unique file.
57
57
AC_CONFIG_SRCDIR([sbuild/sbuild-session.cc])
58
58
dnl Place auxilliary scripts here.
59
59
AC_CONFIG_AUX_DIR([scripts])
60
 
dnl Put macro definitions here.
 
60
dnl Add config headers.
61
61
AC_CONFIG_HEADER([config.h])
62
62
AC_CONFIG_HEADER([sbuild/sbuild-config.h])
63
63
 
64
64
AC_COPYRIGHT(
65
65
[
66
 
Copyright © 2004-2008  Roger Leigh <rleigh@debian.org>
 
66
Copyright © 2004-2009  Roger Leigh <rleigh@debian.org>
67
67
 
68
68
Parts of this configure script come from the 'configure.ac' file, and
69
69
are not based on freely-redistributable m4 macros; you can
80
80
along with this program.  If not, see <http://www.gnu.org/licenses/>.
81
81
])
82
82
 
83
 
[SBUILD_MAJOR_VERSION]=SBUILD_MAJOR_VERSION
84
 
[SBUILD_MINOR_VERSION]=SBUILD_MINOR_VERSION
85
 
[SBUILD_MICRO_VERSION]=SBUILD_MICRO_VERSION
86
 
[SBUILD_EXTRA_VERSION]=SBUILD_EXTRA_VERSION
87
83
[SBUILD_CURRENT_INTERFACE]=SBUILD_CURRENT_INTERFACE
88
84
[SBUILD_INTERFACE_AGE]=SBUILD_INTERFACE_AGE
89
85
[SBUILD_BINARY_AGE]=SBUILD_BINARY_AGE
90
 
[SBUILD_VERSION]=SBUILD_VERSION
91
 
popdef([SBUILD_MAJOR_VERSION])
92
 
popdef([SBUILD_MINOR_VERSION])
93
 
popdef([SBUILD_MICRO_VERSION])
94
 
popdef([SBUILD_EXTRA_VERSION])
95
86
popdef([SBUILD_CURRENT_INTERFACE])
96
87
popdef([SBUILD_INTERFACE_AGE])
97
88
popdef([SBUILD_BINARY_AGE])
98
 
popdef([SBUILD_NAME])
99
 
popdef([SBUILD_VERSION])
100
89
 
101
 
AC_SUBST([SBUILD_MAJOR_VERSION])
102
 
AC_SUBST([SBUILD_MINOR_VERSION])
103
 
AC_SUBST([SBUILD_MICRO_VERSION])
104
90
AC_SUBST([SBUILD_CURRENT_INTERFACE])
105
91
AC_SUBST([SBUILD_INTERFACE_AGE])
106
92
AC_SUBST([SBUILD_BINARY_AGE])
107
 
AC_SUBST([SBUILD_VERSION])
108
93
 
109
94
dnl Initialise automake stuff.
110
 
AM_INIT_AUTOMAKE([1.9 gnu check-news dist-bzip2 no-dist-gzip tar-pax])
 
95
AM_INIT_AUTOMAKE([1.10 gnu check-news dist-bzip2 no-dist-gzip tar-pax silent-rules])
111
96
AM_MAINTAINER_MODE
112
 
SCHROOT_RELEASE_DATE
 
97
RELEASE_DATE='sbuild_m4_esyscmd_s(date --date='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])' '+%s')'
 
98
RELEASE_DATE_S='sbuild_m4_esyscmd_s([sed -ne '/^Release-Date:/{s/Release-Date:[[:space:]][[:space:]]*//p;q}' VERSION])'
 
99
AC_DEFINE_UNQUOTED([RELEASE_DATE_S], ["$RELEASE_DATE_S"], [Package release date (string).])
 
100
AC_DEFINE_UNQUOTED([RELEASE_DATE], [$RELEASE_DATE], [Package release date (integer).])
 
101
AC_SUBST([RELEASE_DATE])
 
102
AC_SUBST([RELEASE_DATE_S])
113
103
 
114
104
AC_MSG_CHECKING([whether to enable dchroot compatibility])
115
105
AC_ARG_ENABLE([dchroot], [AS_HELP_STRING([--enable-dchroot], [Enable dchroot compatibility])],
116
106
              [ case "${enableval}" in
117
107
                yes) enable_dchroot_compat="yes" ;;
118
108
                no)  enable_dchroot_compat="no" ;;
119
 
                unset)  enable_dchroot_compat="no" ;;
120
109
                *) AC_MSG_RESULT([unknown])
121
110
                   AC_MSG_ERROR([bad value ${enableval} for --enable-dchroot]) ;;
122
 
                esac])
123
 
if test "$enable_dchroot_compat" = ""; then
124
 
  enable_dchroot_compat="no"
125
 
fi
 
111
                esac ],
 
112
              [ enable_dchroot_compat="no" ])
126
113
AC_MSG_RESULT([$enable_dchroot_compat])
127
114
AM_CONDITIONAL([BUILD_DCHROOT], [test "$enable_dchroot_compat" = "yes"])
128
115
 
131
118
              [ case "${enableval}" in
132
119
                yes) enable_dchroot_dsa_compat="yes" ;;
133
120
                no)  enable_dchroot_dsa_compat="no" ;;
134
 
                unset)  enable_dchroot_dsa_compat="no" ;;
135
121
                *) AC_MSG_RESULT([unknown])
136
122
                   AC_MSG_ERROR([bad value ${enableval} for --enable-dchroot-dsa]) ;;
137
 
                esac])
138
 
if test "$enable_dchroot_dsa_compat" = ""; then
139
 
  enable_dchroot_dsa_compat="no"
140
 
fi
 
123
                esac ],
 
124
              [ enable_dchroot_dsa_compat="no" ])
141
125
AC_MSG_RESULT([$enable_dchroot_dsa_compat])
142
126
AM_CONDITIONAL([BUILD_DCHROOT_DSA], [test "$enable_dchroot_dsa_compat" = "yes"])
143
127
AM_CONDITIONAL([BUILD_LIBDCHROOT], [test "$enable_dchroot_compat" = "yes" || test "$enable_dchroot_dsa_compat" = "yes"])
147
131
              [ case "${enableval}" in
148
132
                yes) enable_csbuild_compat="yes" ;;
149
133
                no)  enable_csbuild_compat="no" ;;
150
 
                unset)  enable_csbuild_compat="no" ;;
151
134
                *) AC_MSG_RESULT([unknown])
152
135
                   AC_MSG_ERROR([bad value ${enableval} for --enable-csbuild]) ;;
153
 
                esac])
154
 
if test "$enable_csbuild_compat" = ""; then
155
 
  enable_csbuild_compat="no"
156
 
fi
 
136
                esac ],
 
137
              [ enable_csbuild_compat="no" ])
 
138
 
157
139
AC_MSG_RESULT([$enable_csbuild_compat])
158
140
AM_CONDITIONAL([BUILD_CSBUILD], [test "$enable_csbuild_compat" = "yes"])
159
141
 
162
144
              [ case "${enableval}" in
163
145
                yes) enable_debug="yes" ;;
164
146
                no)  enable_debug="no" ;;
165
 
                unset)  enable_debug="no" ;;
166
147
                *) AC_MSG_RESULT([unknown])
167
148
                   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
168
 
                esac])
169
 
if test "$enable_debug" = ""; then
170
 
  enable_debug="no"
171
 
fi
 
149
                esac ],
 
150
              [ enable_debug="no" ])
172
151
AC_MSG_RESULT([$enable_debug])
173
152
if test "$enable_debug" = "yes"; then
174
153
  AC_DEFINE_UNQUOTED([SBUILD_DEBUG], [1], [Enable debugging])
175
154
fi
176
155
 
 
156
default_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)$'
 
157
 
 
158
AC_MSG_CHECKING([whether to enable environment filtering regex])
 
159
AC_ARG_ENABLE([environment-filter], [AS_HELP_STRING([--enable-environment-filter], [Enable default environment filtering (regex)])],
 
160
              [ case "${enableval}" in
 
161
                yes) enable_environment_filter="$default_environment_filter" ;;
 
162
                no)  enable_environment_filter="" ;;
 
163
                *) enable_environment_filter="${enableval}" ;;
 
164
                esac ],
 
165
              [ enable_environment_filter="$default_environment_filter" ])
 
166
AC_MSG_RESULT([$enable_environment_filter])
 
167
AH_TEMPLATE(SBUILD_DEFAULT_ENVIRONMENT_FILTER, [Default regular expression used to filter user environment])
 
168
AC_DEFINE_UNQUOTED([SBUILD_DEFAULT_ENVIRONMENT_FILTER], ["$enable_environment_filter"])
 
169
 
 
170
AC_MSG_CHECKING([whether to enable support for PAM authentication])
 
171
AC_ARG_ENABLE([pam], [AS_HELP_STRING([--enable-pam], [Enable support for PAM authentication (requires libpam)])],
 
172
              [ case "${enableval}" in
 
173
                yes) enable_pam="yes" ;;
 
174
                no)  enable_pam="no" ;;
 
175
                *) AC_MSG_RESULT([unknown])
 
176
                   AC_MSG_ERROR([bad value ${enableval} for --enable-pam]) ;;
 
177
                esac],
 
178
              [enable_pam="auto"])
 
179
AC_MSG_RESULT([$enable_pam])
 
180
 
 
181
AC_MSG_CHECKING([whether to enable support for block devices])
 
182
AC_ARG_ENABLE([block-device], [AS_HELP_STRING([--enable-block-device], [Enable support for block devices (requires liblockdev)])],
 
183
              [ case "${enableval}" in
 
184
                yes) enable_blockdev="yes" ;;
 
185
                no)  enable_blockdev="no" ;;
 
186
                *) AC_MSG_RESULT([unknown])
 
187
                   AC_MSG_ERROR([bad value ${enableval} for --enable-blockdev]) ;;
 
188
                esac],
 
189
              [enable_blockdev="auto"])
 
190
AC_MSG_RESULT([$enable_blockdev])
 
191
 
 
192
AC_MSG_CHECKING([whether to enable support for LVM snapshots])
 
193
AC_ARG_ENABLE([lvm-snapshot], [AS_HELP_STRING([--enable-lvm-snapshot], [Enable support for LVM snapshots (requires LVM and liblockdev)])],
 
194
              [ case "${enableval}" in
 
195
                yes) enable_lvmsnapshot="yes"
 
196
                     enable_blockdev="yes" ;;
 
197
                no)  enable_lvmsnapshot="no" ;;
 
198
                *) AC_MSG_RESULT([unknown])
 
199
                   AC_MSG_ERROR([bad value ${enableval} for --enable-lvm-snapshot]) ;;
 
200
                esac],
 
201
              [enable_lvmsnapshot="auto"])
 
202
AC_MSG_RESULT([$enable_lvmsnapshot])
 
203
 
 
204
AC_MSG_CHECKING([whether to enable support for loopback mounts])
 
205
AC_ARG_ENABLE([loopback], [AS_HELP_STRING([--enable-loopback], [Enable support for loopback mounts])],
 
206
              [ case "${enableval}" in
 
207
                yes) enable_loopback="yes" ;;
 
208
                no)  enable_loopback="no" ;;
 
209
                *) AC_MSG_RESULT([unknown])
 
210
                   AC_MSG_ERROR([bad value ${enableval} for --enable-loopback]) ;;
 
211
                esac],
 
212
              [enable_loopback="auto"])
 
213
AC_MSG_RESULT([$enable_loopback])
 
214
 
 
215
AC_MSG_CHECKING([whether to enable support for UUIDs in session names])
 
216
AC_ARG_ENABLE([uuid], [AS_HELP_STRING([--enable-uuid], [Enable support for UUIDs])],
 
217
              [ case "${enableval}" in
 
218
                yes) enable_uuid="yes" ;;
 
219
                no)  enable_uuid="no" ;;
 
220
                *) AC_MSG_RESULT([unknown])
 
221
                   AC_MSG_ERROR([bad value ${enableval} for --enable-uuid]) ;;
 
222
                esac],
 
223
              [enable_uuid="auto"])
 
224
AC_MSG_RESULT([$enable_uuid])
 
225
 
 
226
AC_MSG_CHECKING([whether to enable support for union mounts])
 
227
AC_ARG_ENABLE([union], [AS_HELP_STRING([--enable-union], [Enable support for union mounts])],
 
228
              [ case "${enableval}" in
 
229
                yes) enable_union="yes" ;;
 
230
                no)  enable_union="no" ;;
 
231
                *) AC_MSG_RESULT([unknown])
 
232
                   AC_MSG_ERROR([bad value ${enableval} for --enable-union]) ;;
 
233
                esac],
 
234
              [enable_union="auto"])
 
235
AC_MSG_RESULT([$enable_union])
 
236
 
 
237
AC_MSG_CHECKING([whether to enable doxygen documentation])
 
238
AC_ARG_ENABLE([doxygen], [AS_HELP_STRING([--enable-doxygen], [Enable doxygen documentation])],
 
239
              [ case "${enableval}" in
 
240
                yes) enable_doxygen="yes" ;;
 
241
                no)  enable_doxygen="no" ;;
 
242
                *) AC_MSG_RESULT([unknown])
 
243
                   AC_MSG_ERROR([bad value ${enableval} for --enable-doxygen]) ;;
 
244
                esac],
 
245
              [ enable_doxygen="no" ])
 
246
AC_MSG_RESULT([$enable_doxygen])
 
247
AM_CONDITIONAL([BUILD_DOXYGEN], [test "$enable_doxygen" = "yes"])
 
248
 
 
249
AC_MSG_CHECKING([for bash completion directory])
 
250
bashcompletiondir='${sysconfdir}/bash_completion.d'
 
251
AC_ARG_WITH([bash-completion-dir], [AS_HELP_STRING([--with-bash-completion-dir], [bash shell completion directory])],
 
252
              [bashcompletiondir="${withval}"])
 
253
AC_MSG_RESULT([$bashcompletiondir])
 
254
AC_SUBST([bashcompletiondir])
 
255
 
177
256
# Checks for programs.
178
257
AC_PROG_CXX
179
258
AC_LANG([C++])
180
259
ACX_PTHREAD([], [AC_MSG_ERROR([POSIX thread support is required for correct std::tr1::shared_ptr operation])])
181
 
AC_ENABLE_SHARED
182
 
AC_DISABLE_STATIC
 
260
AC_DISABLE_SHARED
 
261
AC_ENABLE_STATIC
183
262
AC_PROG_LIBTOOL
184
263
AM_GNU_GETTEXT_VERSION([0.16])
185
264
AM_GNU_GETTEXT([external])
186
265
AC_PATH_PROG([FIND], [find])
187
266
AC_PATH_PROG([XARGS], [xargs])
188
267
AC_PATH_PROG([DOXYGEN], [doxygen])
189
 
AM_CONDITIONAL([USE_DOXYGEN], [test -n "$DOXYGEN"])
 
268
HAVE_LVM="yes"
 
269
AC_PATH_PROG([LVCREATE], [lvcreate], [HAVE_LVM="no"], [$PATH:/sbin:/usr/sbin])
 
270
AC_PATH_PROG([LVREMOVE], [lvremove], [HAVE_LVM="no"], [$PATH:/sbin:/usr/sbin])
 
271
HAVE_LOOPBACK="yes"
 
272
AC_PATH_PROG([LOSETUP], [losetup], [HAVE_LOOPBACK="no"], [$PATH:/sbin:/usr/sbin])
 
273
 
 
274
if test "$enable_doxygen" = "yes" && test -z "$DOXYGEN"; then
 
275
  AC_MSG_FAILURE([doxygen is not installed, but is required by schroot])
 
276
fi;
 
277
AM_CONDITIONAL([BUILD_DOXYGEN], [test -n "$DOXYGEN" && test "$enable_doxygen" = "yes"])
190
278
 
191
279
# Checks for libraries.
192
 
AH_TEMPLATE(HAVE_UUID, [Is libuuid available])
193
280
PKG_CHECK_MODULES([UUID], [uuid],
194
281
                  [AC_DEFINE(HAVE_UUID)
195
 
                   HAVE_UUID=true],
196
 
                  [HAVE_UUID=false])
 
282
                   HAVE_UUID=yes],
 
283
                  [HAVE_UUID=no])
197
284
 
198
 
AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=true])
 
285
AM_PATH_CPPUNIT([1.10.0], [HAVE_CPPUNIT=yes])
199
286
AM_CONDITIONAL([USE_UNIT_TESTS], [test -n "$HAVE_CPPUNIT"])
200
287
 
201
288
SCHROOT_CFLAGS="$UUID_CFLAGS"
226
313
 
227
314
AC_CHECK_HEADERS([ext/stdio_filebuf.h],, [AC_MSG_ERROR([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
228
315
 
 
316
AC_CHECK_HEADERS([sys/personality.h],
 
317
                 [PERSONALITY_HEADER="yes"],
 
318
                 [PERSONALITY_HEADER="no"])
 
319
 
 
320
AC_CHECK_HEADERS([security/pam_appl.h],
 
321
                 [PAM_HEADER="yes"],
 
322
                 [PAM_HEADER="no"])
 
323
 
229
324
# Checks for typedefs, structures, and compiler characteristics.
230
325
 
231
326
# Checks for library functions.
232
327
AC_CHECK_LIB([pam], [pam_authenticate],
233
 
             [PAM_LIBS="-lpam"],
234
 
             [AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])])
 
328
             [PAM_LIBS="-lpam"
 
329
              PAM_FUNC="yes"],
 
330
             [PAM_LIBS=""
 
331
              PAM_FUNC="no"])
235
332
AC_SUBST([PAM_LIBS])
236
333
 
237
334
AC_CHECK_LIB([lockdev], [dev_lock],
238
 
             [LOCKDEV_LIBS="-llockdev"],
239
 
             [AC_MSG_FAILURE([liblockdev (lockdev) is not installed, but is required by schroot])])
 
335
             [LOCKDEV_LIBS="-llockdev"
 
336
              HAVE_LOCKDEV="yes"],
 
337
             [LOCKDEV_LIBS=""
 
338
              HAVE_LOCKDEV="no"])
240
339
AC_SUBST([LOCKDEV_LIBS])
241
 
 
242
 
AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options-mt])
243
 
saved_ldflags="${LDFLAGS}"
244
 
LDFLAGS="${LDFLAGS} -lboost_program_options-mt"
 
340
AH_TEMPLATE(SBUILD_FEATURE_DEVLOCK, [Set if the device locking with liblockdev is available])
 
341
if test "$HAVE_LOCKDEV" = "yes"; then
 
342
  AC_DEFINE(SBUILD_FEATURE_DEVLOCK, 1)
 
343
fi
 
344
 
 
345
AC_CHECK_FUNC([personality],
 
346
              [PERSONALITY_FUNC="yes"],
 
347
              [PERSONALITY_FUNC="no"])
 
348
 
 
349
# Determine which features to enable.
 
350
AC_MSG_CHECKING([whether to build personality support])
 
351
BUILD_PERSONALITY="yes"
 
352
if test "$PERSONALITY_HEADER" = "no"; then
 
353
  BUILD_PERSONALITY="no"
 
354
fi
 
355
if test "$PERSONALITY_FUNC" = "no"; then
 
356
  BUILD_PERSONALITY="no"
 
357
fi
 
358
AC_MSG_RESULT([$BUILD_PERSONALITY])
 
359
 
 
360
AM_CONDITIONAL([BUILD_PERSONALITY], [test "$BUILD_PERSONALITY" = "yes"])
 
361
AH_TEMPLATE(SBUILD_FEATURE_PERSONALITY, [Set if personality support is present])
 
362
if test "$BUILD_PERSONALITY" = "yes"; then
 
363
  AC_DEFINE(SBUILD_FEATURE_PERSONALITY, 1)
 
364
fi
 
365
 
 
366
AC_MSG_CHECKING([whether to build UUID support])
 
367
BUILD_UUID="yes"
 
368
if test "$enable_uuid" = "yes"; then
 
369
  BUILD_UUID="no"
 
370
fi
 
371
if test "$HAVE_UUID" = "no"; then
 
372
  BUILD_UUID="no"
 
373
fi
 
374
AC_MSG_RESULT([$BUILD_UUID])
 
375
 
 
376
AH_TEMPLATE(HAVE_UUID, [Set if UUID support is available])
 
377
if test "$BUILD_UUID" = "yes"; then
 
378
  AC_DEFINE(HAVE_UUID, 1)
 
379
fi
 
380
 
 
381
AC_MSG_CHECKING([whether to build PAM support])
 
382
BUILD_PAM="yes"
 
383
if test "$enable_pam" = "yes"; then
 
384
  if test "$PAM_HEADER" = "no"; then
 
385
    BUILD_PAM="no"
 
386
    AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])
 
387
  fi
 
388
  if test "$PAM_FUNC" = "no"; then
 
389
    BUILD_PAM="no"
 
390
    AC_MSG_FAILURE([libpam (Linux-PAM) is not installed, but is required by schroot])
 
391
  fi
 
392
elif test "$enable_pam" = "no"; then
 
393
    BUILD_PAM="no"
 
394
elif test "$enable_pam" = "auto"; then
 
395
  if test "$PAM_HEADER" = "no"; then
 
396
    BUILD_PAM="no"
 
397
  fi
 
398
  if test "$PAM_FUNC" = "no"; then
 
399
    BUILD_PAM="no"
 
400
  fi
 
401
fi
 
402
AC_MSG_RESULT([$BUILD_PAM])
 
403
 
 
404
AM_CONDITIONAL([BUILD_PAM], [test "$BUILD_PAM" = "yes"])
 
405
AH_TEMPLATE(SBUILD_FEATURE_PAM, [Set if PAM support is available])
 
406
if test "$BUILD_PAM" = "yes"; then
 
407
  AC_DEFINE(SBUILD_FEATURE_PAM, 1)
 
408
fi
 
409
 
 
410
AC_MSG_CHECKING([whether to build block-device support])
 
411
BUILD_BLOCKDEV="yes"
 
412
if test "$enable_blockdev" = "yes"; then
 
413
  if test "$HAVE_LOCKDEV" = "no"; then
 
414
    BUILD_BLOCKDEV="no"
 
415
    AC_MSG_FAILURE([liblockdev (lockdev) is not installed, but is required by schroot])
 
416
  fi
 
417
elif test "$enable_blockdev" = "no"; then
 
418
    BUILD_BLOCKDEV="no"
 
419
elif test "$enable_blockdev" = "auto"; then
 
420
  if test "$HAVE_LOCKDEV" = "no"; then
 
421
    BUILD_BLOCKDEV="no"
 
422
  fi
 
423
fi
 
424
AC_MSG_RESULT([$BUILD_BLOCKDEV])
 
425
 
 
426
AM_CONDITIONAL([BUILD_BLOCKDEV], [test "$BUILD_BLOCKDEV" = "yes"])
 
427
AH_TEMPLATE(SBUILD_FEATURE_BLOCKDEV, [Set if the block-device chroot type is present])
 
428
if test "$BUILD_BLOCKDEV" = "yes"; then
 
429
  AC_DEFINE(SBUILD_FEATURE_BLOCKDEV, 1)
 
430
fi
 
431
 
 
432
AC_MSG_CHECKING([whether to build lvm-snapshot support])
 
433
BUILD_LVMSNAP="yes"
 
434
if test "$enable_lvmsnapshot" = "yes"; then
 
435
  if test "$HAVE_LVM" = "no"; then
 
436
    BUILD_LVMSNAP="no"
 
437
    AC_MSG_FAILURE([LVM (lvm) is not installed, but is required by schroot])
 
438
  fi
 
439
elif test "$enable_lvmsnapshot" = "no"; then
 
440
    BUILD_LVMSNAP="no"
 
441
elif test "$enable_lvmsnapshot" = "auto"; then
 
442
  if test "$HAVE_LOCKDEV" = "no"; then
 
443
    BUILD_LVMSNAP="no"
 
444
  fi
 
445
  if test "$HAVE_LVM" = "no"; then
 
446
    BUILD_LVMSNAP="no"
 
447
  fi
 
448
fi
 
449
AC_MSG_RESULT([$BUILD_LVMSNAP])
 
450
 
 
451
AM_CONDITIONAL([BUILD_LVMSNAP], [test "$BUILD_LVMSNAP" = "yes"])
 
452
AH_TEMPLATE(SBUILD_FEATURE_LVMSNAP, [Set if the lvm-snapshot chroot type is present])
 
453
if test "$BUILD_LVMSNAP" = "yes"; then
 
454
  AC_DEFINE(SBUILD_FEATURE_LVMSNAP, 1)
 
455
fi
 
456
 
 
457
AC_MSG_CHECKING([whether to build loopback support])
 
458
BUILD_LOOPBACK="yes"
 
459
if test "$enable_loopbackshot" = "yes"; then
 
460
  if test "$HAVE_LOOPBACK" = "no"; then
 
461
    BUILD_LOOPBACK="no"
 
462
    AC_MSG_FAILURE([Loopback support is not avilable, but is required by schroot])
 
463
  fi
 
464
elif test "$enable_loopbackshot" = "no"; then
 
465
    BUILD_LOOPBACK="no"
 
466
elif test "$enable_loopbackshot" = "auto"; then
 
467
  if test "$HAVE_LOOPBACK" = "no"; then
 
468
    BUILD_LOOPBACK="no"
 
469
  fi
 
470
fi
 
471
AC_MSG_RESULT([$BUILD_LOOPBACK])
 
472
 
 
473
AM_CONDITIONAL([BUILD_LOOPBACK], [test "$BUILD_LOOPBACK" = "yes"])
 
474
AH_TEMPLATE(SBUILD_FEATURE_LOOPBACK, [Set if the loopback chroot type is present])
 
475
if test "$BUILD_LOOPBACK" = "yes"; then
 
476
  AC_DEFINE(SBUILD_FEATURE_LOOPBACK, 1)
 
477
fi
 
478
 
 
479
AC_MSG_CHECKING([whether to build union support])
 
480
BUILD_UNION="yes"
 
481
if test "$enable_union" = "yes"; then
 
482
  :
 
483
elif test "$enable_union" = "no"; then
 
484
  BUILD_UNION="no"
 
485
elif test "$enable_union" = "auto"; then
 
486
  BUILD_UNION="yes"
 
487
fi
 
488
AC_MSG_RESULT([$BUILD_UNION])
 
489
 
 
490
AM_CONDITIONAL([BUILD_UNION], [test "$BUILD_UNION" = "yes"])
 
491
AH_TEMPLATE(SBUILD_FEATURE_UNION, [Set if the union filesystem type is present])
 
492
if test "$BUILD_UNION" = "yes"; then
 
493
  AC_DEFINE(SBUILD_FEATURE_UNION, 1)
 
494
fi
 
495
 
 
496
AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options])
 
497
saved_LIBS="${LIBS}"
 
498
LIBS="${LIBS} -lboost_program_options"
245
499
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
246
500
                               [boost::program_options::variables_map::variables_map dummy()])],
247
501
               [AC_MSG_RESULT([yes])
248
 
                BOOST_LIBS="${BOOST_LIBS} -lboost_program_options-mt"],
 
502
                BOOST_LIBS="${BOOST_LIBS} -lboost_program_options"],
249
503
               [AC_MSG_RESULT([no])
250
504
                AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
251
 
LDFLAGS="${saved_ldflags}"
 
505
LIBS="${saved_LIBS}"
252
506
 
253
 
AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options-mt])
254
 
saved_ldflags="${LDFLAGS}"
255
 
LDFLAGS="${LDFLAGS} -lboost_program_options-mt"
 
507
AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options])
 
508
saved_LIBS="${LIBS}"
 
509
LIBS="${LIBS} -lboost_program_options"
256
510
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
257
511
                               [boost::program_options::options_description testgrp("test group");
258
512
                                bool notused = testgrp.options().empty();
261
515
                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
262
516
               [AC_MSG_RESULT([no])
263
517
                BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"])
264
 
LDFLAGS="${saved_ldflags}"
 
518
LIBS="${saved_LIBS}"
265
519
AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available])
266
520
if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then
267
521
  AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
268
522
fi
269
523
 
270
 
AC_MSG_CHECKING([for boost::regex in -lboost_regex-mt])
271
 
saved_ldflags="${LDFLAGS}"
272
 
LDFLAGS="${LDFLAGS} -lboost_regex-mt"
 
524
AC_MSG_CHECKING([for boost::regex in -lboost_regex])
 
525
saved_LIBS="${LIBS}"
 
526
LIBS="${LIBS} -lboost_regex"
273
527
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>],
274
528
                               [boost::regex("^foo[bar]$")])],
275
529
               [AC_MSG_RESULT([yes])
276
 
                BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"],
 
530
                BOOST_LIBS="${BOOST_LIBS} -lboost_regex"],
277
531
               [AC_MSG_RESULT([no])
278
532
                AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])
279
 
LDFLAGS="${saved_ldflags}"
 
533
LIBS="${saved_LIBS}"
280
534
 
281
 
AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem-mt])
282
 
saved_ldflags="${LDFLAGS}"
283
 
LDFLAGS="${LDFLAGS} -lboost_filesystem-mt"
 
535
AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem])
 
536
saved_LIBS="${LIBS}"
 
537
LIBS="${LIBS} -lboost_filesystem"
284
538
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
285
539
                               [boost::filesystem::is_directory("/")])],
286
540
               [AC_MSG_RESULT([yes])
287
 
                BOOST_LIBS="${BOOST_LIBS} -lboost_filesystem-mt"],
 
541
                BOOST_FILESYSTEM_LIBS="-lboost_filesystem"],
288
542
               [AC_MSG_RESULT([no])
289
543
                AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])])
290
 
LDFLAGS="${saved_ldflags}"
 
544
LIBS="${saved_LIBS}"
291
545
 
292
546
AC_SUBST([BOOST_LIBS])
 
547
AC_SUBST([BOOST_FILESYSTEM_LIBS])
293
548
 
294
 
AC_MSG_CHECKING([__gnu_cxx::stdio_filebuf construction semantics])
 
549
AC_MSG_CHECKING([for __gnu_cxx::stdio_filebuf in libstdc++])
295
550
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ext/stdio_filebuf.h>
296
551
#include <unistd.h>],
297
552
                                [__gnu_cxx::stdio_filebuf<char> fdbuf(STDOUT_FILENO, std::ios::out)])],
298
 
               [AC_MSG_RESULT([new (GCC >= 3.4)])
299
 
                STDIO_FILEBUF="new"],
300
 
               [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ext/stdio_filebuf.h>
301
 
#include <unistd.h>],
302
 
                               [__gnu_cxx::stdio_filebuf<char> fdbuf(STDOUT_FILENO, std::ios::out, true, BUFSIZ)])],
303
 
                               [AC_MSG_RESULT([old (GCC < 3.4)])
304
 
                                STDIO_FILEBUF="old"],
305
 
                               [AC_MSG_FAILURE([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])])
306
 
 
307
 
AH_TEMPLATE(SCHROOT_FILEBUF_OLD, [Set if old __gnu_cxx::stdio_filebuf construction semantics are required])
308
 
if test "$STDIO_FILEBUF" = "old"; then
309
 
  AC_DEFINE(SCHROOT_FILEBUF_OLD, 1)
310
 
fi
 
553
               [AC_MSG_RESULT([yes])],
 
554
               [AC_MSG_RESULT([no])
 
555
                AC_MSG_FAILURE([__gnu_cxx::stdio_filebuf (GNU libstdc++) is not installed, but is required by schroot])])
311
556
 
312
557
dnl Set PACKAGE_LOCALE_DIR in config.h
313
558
AH_TEMPLATE(PACKAGE_LOCALE_DIR, [Package locale directory])
394
639
AH_TEMPLATE(SCHROOT_SESSION_DIR, [schroot session directory])
395
640
AC_DEFINE_UNQUOTED(SCHROOT_SESSION_DIR, ["$SCHROOT_SESSION_DIR"])
396
641
 
 
642
SCHROOT_FILE_UNPACK_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/unpack"
 
643
AC_SUBST([SCHROOT_FILE_UNPACK_DIR])
 
644
AH_TEMPLATE(SCHROOT_FILE_UNPACK_DIR, [schroot file unpack directory])
 
645
AC_DEFINE_UNQUOTED(SCHROOT_FILE_UNPACK_DIR, ["$SCHROOT_FILE_UNPACK_DIR"])
 
646
 
 
647
SCHROOT_OVERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/overlay"
 
648
AC_SUBST([SCHROOT_OVERLAY_DIR])
 
649
AH_TEMPLATE(SCHROOT_OVERLAY_DIR, [schroot overlay directory])
 
650
AC_DEFINE_UNQUOTED(SCHROOT_OVERLAY_DIR, ["$SCHROOT_OVERLAY_DIR"])
 
651
 
 
652
SCHROOT_UNDERLAY_DIR="${PACKAGE_LOCALSTATE_DIR}/lib/${PACKAGE}/union/underlay"
 
653
AC_SUBST([SCHROOT_UNDERLAY_DIR])
 
654
AH_TEMPLATE(SCHROOT_UNDERLAY_DIR, [schroot underlay directory])
 
655
AC_DEFINE_UNQUOTED(SCHROOT_UNDERLAY_DIR, ["$SCHROOT_UNDERLAY_DIR"])
 
656
 
397
657
dnl Set PACKAGE_SYSCONF_DIR in config.h.
398
658
AH_TEMPLATE(PACKAGE_SYSCONF_DIR, [Package system configuration directory])
399
659
if test "x${sysconfdir}" = 'x${prefix}/etc'; then
427
687
AH_TEMPLATE(SCHROOT_CONF_SETUP_D, [schroot chroot setup directory])
428
688
AC_DEFINE_UNQUOTED(SCHROOT_CONF_SETUP_D, ["$SCHROOT_CONF_SETUP_D"])
429
689
 
430
 
SCHROOT_CONF_EXEC_D="${PACKAGE_SYSCONF_DIR}/exec.d"
431
 
AC_SUBST([SCHROOT_CONF_EXEC_D])
432
 
 
433
 
AH_TEMPLATE(SCHROOT_CONF_EXEC_D, [schroot chroot exec directory])
434
 
AC_DEFINE_UNQUOTED(SCHROOT_CONF_EXEC_D, ["$SCHROOT_CONF_EXEC_D"])
435
 
 
436
690
AH_TEMPLATE(SCHROOT_DATADIR, [Package data directory])
437
691
SCHROOT_DATADIR="${PACKAGE_DATA_DIR}/${PACKAGE_VERSION}"
438
692
AC_DEFINE_UNQUOTED(SCHROOT_DATADIR, ["$SCHROOT_DATADIR"])
473
727
AC_CONFIG_FILES([bin/Makefile])
474
728
AC_CONFIG_FILES([bin/schroot-base/Makefile])
475
729
AC_CONFIG_FILES([bin/schroot/Makefile])
476
 
AC_CONFIG_FILES([bin/schroot/pam/Makefile])
477
 
AC_CONFIG_FILES([bin/schroot/exec/Makefile])
478
 
AC_CONFIG_FILES([bin/schroot/setup/Makefile])
479
 
AC_CONFIG_FILES([bin/schroot/schroot.1])
480
 
AC_CONFIG_FILES([bin/schroot/schroot-setup.5])
481
 
AC_CONFIG_FILES([bin/schroot/schroot.conf.5])
482
 
AC_CONFIG_FILES([bin/schroot/schroot-script-config.5])
483
730
AC_CONFIG_FILES([bin/schroot-listmounts/Makefile])
484
731
AC_CONFIG_FILES([bin/schroot-mount/Makefile])
485
732
AC_CONFIG_FILES([bin/schroot-releaselock/Makefile])
486
733
AC_CONFIG_FILES([bin/dchroot/Makefile])
487
 
AC_CONFIG_FILES([bin/dchroot/dchroot.1])
488
734
AC_CONFIG_FILES([bin/dchroot-dsa/Makefile])
489
 
AC_CONFIG_FILES([bin/dchroot-dsa/dchroot-dsa.1])
490
735
AC_CONFIG_FILES([bin/csbuild/Makefile])
491
 
AC_CONFIG_FILES([bin/csbuild/csbuild.1])
 
736
AC_CONFIG_FILES([etc/Makefile])
 
737
AC_CONFIG_FILES([etc/pam/Makefile])
 
738
AC_CONFIG_FILES([etc/setup.d/Makefile])
 
739
AC_CONFIG_FILES([etc/bash_completion/Makefile])
 
740
AC_CONFIG_FILES([man/Makefile])
 
741
AC_CONFIG_FILES([man/schroot.1])
 
742
AC_CONFIG_FILES([man/schroot-setup.5])
 
743
AC_CONFIG_FILES([man/schroot.conf.5])
 
744
AC_CONFIG_FILES([man/schroot-script-config.5])
 
745
AC_CONFIG_FILES([man/dchroot.1])
 
746
AC_CONFIG_FILES([man/dchroot-dsa.1])
 
747
AC_CONFIG_FILES([man/csbuild.1])
492
748
AC_CONFIG_FILES([scripts/po-notify])
493
749
AC_CONFIG_FILES([test/Makefile])
494
750
AC_CONFIG_FILES([Makefile])