1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_SRCDIR([common-src/amanda.h])
5 AC_CONFIG_AUX_DIR(config)
6 AC_CANONICAL_TARGET([])
9 CONFIGURE_COMMAND="'$0'"
11 CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
13 AC_DEFINE_UNQUOTED(CONFIGURE_COMMAND,"$CONFIGURE_COMMAND",
14 [Saves the original ./configure command line arguments])
15 AC_SUBST(CONFIGURE_COMMAND)
17 AM_INIT_AUTOMAKE(amanda, 2.5.0p2)
18 AM_CONFIG_HEADER(config/config.h)
20 AC_PREREQ(2.57) dnl Minimum Autoconf version required.
22 if test -f "$srcdir/SNAPSHOT"; then
23 cat < "$srcdir/SNAPSHOT"
25 snapdate=`sed -n '/^Snapshot Date: \([0-9]*\)/ s//\1/p' < $srcdir/SNAPSHOT`
27 test -z "$snapdate" || VERSION="$VERSION-$snapdate"
28 SNAPSHOT_STAMP=SNAPSHOT
32 AC_SUBST(SNAPSHOT_STAMP)
34 if test -f config.local; then
35 echo "running local script ./config.local"
40 dnl Set the version number of this release of Amanda from the VERSION
41 dnl string, which is set in AM_INIT_AUTOMAKE.
44 VERSION_MAJOR=`expr "$VERSION" : '\([0-9]*\)'`
45 VERSION_MINOR=`expr "$VERSION" : '[0-9]*\.\([0-9]*\)'`
46 VERSION_PATCH=`expr "$VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
47 VERSION_COMMENT=\"`expr "$VERSION" : '[0-9]*\.[0-9]*\.[0-9]*\(.*\)'`\"
50 VERSION_SUFFIX="$VERSION"
51 AC_SUBST(VERSION_MAJOR)
52 AC_SUBST(VERSION_MINOR)
53 AC_SUBST(VERSION_PATCH)
54 AC_SUBST(VERSION_COMMENT)
55 AC_SUBST(VERSION_SUFFIX)
58 dnl runtime and compile time
60 SYSPATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/bsd:/etc:/usr/etc"
62 test "x$prefix" = xNONE && prefix=$ac_default_prefix
63 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
64 eval echo "$libexecdir:$PATH:/usr/local/sbin:/usr/local/bin:/usr/ccs/bin"
66 SYSLOCPATH="$SYSPATH:$LOCPATH"
67 LOCSYSPATH="$LOCPATH:$SYSPATH"
70 [ --with-cflags=CFLAGS arguments to the c compiler (-Wall, -g, etc)],
73 "" | y | ye | yes | n | no)
74 AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.])
81 [ --with-includes=DIR site header files for readline, etc in DIR],
84 "" | y | ye | yes | n | no)
85 AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.])
88 INCLUDE_DIRS="$withval"
91 if test "$INCLUDE_DIRS"; then
92 for dir in $INCLUDE_DIRS; do
93 if test -d "$dir"; then
94 AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir"
96 AC_MSG_WARN([*** Include directory $dir does not exist.])
101 AC_ARG_WITH(libraries,
102 [ --with-libraries=DIR site library directories for readline, etc in DIR],
105 "" | y | ye | yes | n | no)
106 AC_MSG_ERROR([*** You must supply an argument to the --with-libraries option.])
109 LIBRARY_DIRS="$withval"
112 if test "$LIBRARY_DIRS"; then
113 for dir in $LIBRARY_DIRS; do
114 if test -d "$dir"; then
116 *-solaris2*,*-netbsd*)
117 AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir"
120 AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir"
122 AC_MSG_WARN([*** Library directory $dir does not exist.])
127 AC_ARG_WITH(dumperdir,
128 [ --with-dumperdir=DIR where we install the dumpers [[EPREFIX/dumper]]],
131 "" | y | ye | yes | n | no)
132 AC_MSG_ERROR([*** You must supply an argument to the --with-dumperdir option.])
135 DUMPER_DIR="$withval"
137 test "x$prefix" = xNONE && prefix=$ac_default_prefix
138 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
139 DUMPER_DIR=$exec_prefix/dumper
143 test "x$prefix" = xNONE && prefix=$ac_default_prefix
144 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
145 eval echo "$DUMPER_DIR"
147 AC_DEFINE_UNQUOTED(DUMPER_DIR,"$DUMPER_DIR",[Directory in which dumper interfaces should be installed and searched. ])
150 AC_ARG_WITH(configdir,
151 [ --with-configdir=DIR runtime config files in DIR [[sysconfdir/amanda]]],
154 "" | y | ye | yes | n | no)
155 AC_MSG_ERROR([*** You must supply an argument to the --with-configdir option.])
157 *) CONFIG_DIR="$withval"
161 : ${CONFIG_DIR="$sysconfdir/amanda"}
164 test "x$prefix" = xNONE && prefix=$ac_default_prefix
165 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
166 eval echo "$CONFIG_DIR"
168 AC_DEFINE_UNQUOTED(CONFIG_DIR,"$CONFIG_DIR",
169 [The directory in which configuration directories should be created. ])
172 AC_ARG_WITH(indexdir,
173 [ --with-indexdir deprecated, use indexdir in amanda.conf],
174 [ AC_MSG_ERROR([*** --with-indexdir is deprecated, use indexdir in amanda.conf instead.])
178 [ --with-dbdir deprecated, use infofile in amanda.conf],
179 [ AC_MSG_ERROR([*** --with-dbdir is deprecated, use infofile in amanda.conf instead.])
183 [ --with-logdir deprecated, use logfile in amanda.conf],
184 [ AC_MSG_ERROR([*** --with-logdir is deprecated, use logdir in amanda.conf instead.])
187 AC_ARG_WITH(suffixes,
188 [ --with-suffixes install binaries with version string appended to name],
189 USE_VERSION_SUFFIXES=$withval,
190 : ${USE_VERSION_SUFFIXES=no}
192 case "$USE_VERSION_SUFFIXES" in
194 AC_DEFINE(USE_VERSION_SUFFIXES, 1,
195 [Define to have programs use version suffixes when calling other programs.])
197 program_suffix="-$VERSION"
198 # This is from the output of configure.in.
199 if test "x$program_transform_name" = xs,x,x,; then
200 program_transform_name=
202 # Double any \ or $. echo might interpret backslashes.
203 cat <<\EOF_SED > conftestsed
204 s,\\,\\\\,g; s,\$,$$,g
206 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
209 test "x$program_prefix" != xNONE &&
210 program_transform_name="s,^,${program_prefix},; $program_transform_name"
211 # Use a double $ so make ignores it.
212 test "x$program_suffix" != xNONE &&
213 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
215 # sed with no file args requires a program.
216 test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
217 # Remove empty command
218 cat <<\EOF_SED > conftestsed
219 s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
221 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
224 n | no) USE_VERSION_SUFFIXES=no
226 *) AC_MSG_ERROR([*** You must not supply an argument to --with-suffixes option.])
229 AC_SUBST(USE_VERSION_SUFFIXES)
233 CLIENT_SCRIPTS_OPT=amhpfixdevs
236 CLIENT_SCRIPTS_OPT=amsinixfixdevs
243 AC_SUBST(CLIENT_SCRIPTS_OPT)
245 AC_ARG_WITH(client-only,
246 [ --with-client-only deprecated, use --without-server],
247 [ AC_MSG_ERROR([*** --with-client-only is deprecated, use --without-server instead.])
249 AC_ARG_WITH(server-only,
250 [ --with-server-only deprecated, use --without-client],
251 [ AC_MSG_ERROR([*** --with-server-only is deprecated, use --without-client instead.])
255 [ --without-client do not build client stuff],
258 y | ye | yes) NO_CLIENT_MODE=false;;
259 n | no) NO_CLIENT_MODE=true;;
261 AC_MSG_ERROR([*** You must not supply an argument to --with-client option.])
268 [ --without-server do not build server stuff (set --without-restore)],
271 y | ye | yes) NO_SERVER_MODE=false ;;
272 n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;;
274 AC_MSG_ERROR([*** You must not supply an argument to --with-server option. Maybe you meant --with-index-server=$withval])
279 if test "x${NO_SERVER_MODE+set}" != xset ; then
284 [ --without-restore do not build amrestore nor amidxtaped],
287 y | ye | yes) NO_RESTORE_MODE=false;;
288 n | no) NO_RESTORE_MODE=true;;
290 AC_MSG_ERROR([*** You must not supply an argument to --with-restore option.])
295 if test "x${NO_RESTORE_MODE+set}" != xset ; then
296 NO_RESTORE_MODE=${NO_SERVER_MODE-false}
299 if ${NO_SERVER_MODE-false}; then
300 if ${NO_RESTORE_MODE-false}; then
302 dnl --without-server and --without-restore is OK
306 AC_MSG_ERROR([*** --without-server requires --without-restore])
310 AC_ARG_WITH(amrecover,
311 [ --without-amrecover do not build amrecover],
315 if ${NO_CLIENT_MODE-false}; then
316 AC_MSG_ERROR([*** --without-client and --with-amrecover are incompatible])
318 NO_RECOVER_MODE=false;;
319 n | no) NO_RECOVER_MODE=true;;
321 AC_MSG_ERROR([*** You must not supply an argument to --with-amrecover option.])
327 AC_ARG_WITH(index-server,
328 [ --with-index-server=HOST default amanda index server [[`uname -n`]]],
331 "" | y | ye | yes | n | no)
332 AC_MSG_ERROR([*** You must supply an argument to the --with-index-server option.])
334 *) DEFAULT_SERVER="$withval"
338 : ${DEFAULT_SERVER=`uname -n`}
340 AC_DEFINE_UNQUOTED(DEFAULT_SERVER,"$DEFAULT_SERVER",
341 [This is the default Amanda index server. ])
342 AC_SUBST(DEFAULT_SERVER)
344 AC_ARG_WITH(force-uid,
345 [ --without-force-uid do not force the uid to --with-user],
346 FORCE_USERID="$withval",
347 : ${FORCE_USERID=yes}
349 case "$FORCE_USERID" in
350 y | ye | yes) AC_DEFINE(FORCE_USERID, 1,
351 [Define to force to another user on client machines. ])
355 *) AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.])
359 [ --with-user=USER force execution to USER on client systems [[required]]],
362 "" | y | ye | yes | n | no)
363 AC_MSG_ERROR([*** You must supply an argument to the --with-user option.])
365 *) CLIENT_LOGIN="$withval"
370 if test "x${CLIENT_LOGIN+set}" != xset; then
371 AC_MSG_ERROR([*** --with-user=USER is missing])
373 AC_DEFINE_UNQUOTED(CLIENT_LOGIN,"$CLIENT_LOGIN",
374 [Define as a the user to force to on client machines. ])
375 AC_SUBST(CLIENT_LOGIN)
378 [ --with-group=GROUP group allowed to execute setuid-root programs [[required]]],
381 "" | y | ye | yes | n | no)
382 AC_MSG_ERROR([*** You must supply an argument to the --with-group option.])
384 *) SETUID_GROUP="$withval"
389 if test "x${SETUID_GROUP+set}" != xset; then
390 AC_MSG_ERROR([*** --with-group=GROUP is missing])
392 AC_SUBST(SETUID_GROUP)
395 [ --with-owner=USER force ownership of files to USER [[default == --with-user value]]],
398 "" | y | ye | yes | n | no)
399 AC_MSG_ERROR([*** You must supply an argument to the --with-owner option.])
401 *) BINARY_OWNER="$withval"
406 if test "x${BINARY_OWNER+set}" != xset ; then
407 BINARY_OWNER=$CLIENT_LOGIN
409 AC_DEFINE_UNQUOTED(BINARY_OWNER,"$BINARY_OWNER",
410 [Define as the user who owns installed binaries. ])
411 AC_SUBST(BINARY_OWNER)
414 [ --with-rundump use rundump (setuid-root) to invoke dump],
417 n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";;
418 *) AC_MSG_ERROR([*** You must not supply an argument to --with-rundump option.]);;
424 [ --with-config=CONFIG default configuration [[DailySet1]]],
427 "" | y | ye | yes | n | no)
428 AC_MSG_ERROR([*** You must supply an argument to the --with-config option.])
430 *) DEFAULT_CONFIG="$withval"
434 : ${DEFAULT_CONFIG=DailySet1}
436 AC_DEFINE_UNQUOTED(DEFAULT_CONFIG,"$DEFAULT_CONFIG",
437 [This is the default Amanda configuration. ])
438 AC_SUBST(DEFAULT_CONFIG)
440 AC_ARG_WITH(tape-server,
441 [ --with-tape-server=HOST default restoring tape server is HOST [[same as --with-index-server]]],
444 "" | y | ye | yes | n | no)
445 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-server option.])
447 *) DEFAULT_TAPE_SERVER="$withval"
451 : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
453 AC_DEFINE_UNQUOTED(DEFAULT_TAPE_SERVER,"$DEFAULT_TAPE_SERVER",[This is the default restoring Amanda tape server. ])
454 AC_SUBST(DEFAULT_TAPE_SERVER)
456 AC_ARG_WITH(tape-device,
457 [ --with-tape-device=ARG restoring tape server HOST's no rewinding tape drive],
460 "" | y | ye | yes | n | no)
461 AC_MSG_ERROR([*** You must supply an argument to the --with-tape-device option.])
463 *) DEFAULT_TAPE_DEVICE="$withval"
468 if test -z "$DEFAULT_TAPE_DEVICE"; then
469 AC_MSG_CHECKING(for non-rewinding tape device)
470 dnl Check for the /dev/rmt directory and use what's in there.
471 dnl Otherwise look for tape devices in /dev. For the devices
472 dnl in /dev/rmt, we want to use the Berkeley behavior of
473 dnl reading the first record of the next tape file after 0
474 dnl bytes are returned upon reading to the next tape mark,
475 dnl instead of returning an error. Look for devices that have
476 dnl a 'b' in their name.
479 if test -d /dev/rmt; then
481 dnl See if we can find two devices, one being the norewind
482 dnl version of the other. Devices in this directory are
483 dnl normally a digit followed by some characters. We also
484 dnl want the Berkely behavior, since Amanda needs it for
487 for num in 9 8 7 6 5 4 3 2 1 0; do
489 ntd=/dev/rmt/${num}bn
490 if test -r $td -a -r $ntd; then
496 dnl Look for tape devices in /dev.
497 for num in 9 8 7 6 5 4 3 2 1 0; do
500 if test -r $td -a -r $ntd; then
506 DEFAULT_TAPE_DEVICE=$nr_tape_dev
507 AC_MSG_RESULT($DEFAULT_TAPE_DEVICE)
512 if test -z "$DEFAULT_TAPE_DEVICE"; then
513 DEFAULT_TAPE_DEVICE=/dev/null
516 AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",[This is the default no-rewinding tape device. ])
517 AC_SUBST(DEFAULT_TAPE_DEVICE)
519 AC_ARG_WITH(ftape-raw-device,
520 [ --with-ftape-rawdevice=ARG raw device on tape server HOST's if using Linux ftape >=3.04d],
523 "" | y | ye | yes | n | no)
524 AC_MSG_ERROR([*** You must supply an argument to the --with-ftape-rawdevice option.])
526 *) DEFAULT_RAW_TAPE_DEVICE="$withval"
531 if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
532 AC_MSG_CHECKING(for raw ftape device)
533 dnl Look for tape devices in /dev.
534 raw_tape_dev=/dev/null
535 dnl Look for tape devices in /dev.
536 for num in 3 2 1 0 ; do
542 DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev
543 AC_MSG_RESULT($DEFAULT_RAW_TAPE_DEVICE)
548 if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
549 DEFAULT_RAW_TAPE_DEVICE=/dev/null
552 AC_DEFINE_UNQUOTED(DEFAULT_RAW_TAPE_DEVICE,"$DEFAULT_RAW_TAPE_DEVICE",[For Linux systems with floppy tapes:
553 * QIC volume table support via raw tape device. ])
554 AC_SUBST(DEFAULT_RAW_TAPE_DEVICE)
556 AC_ARG_WITH(rew-tape,
557 [ --with-rew-tape deprecated, use --with-tape-device],
558 [ AC_MSG_ERROR([*** --with-rew-tape is deprecated, use --with-tape-device instead.])
561 AC_ARG_WITH(norew-tape,
562 [ --with-norew-tape=ARG deprecated, use --with-tape-device],
563 [ AC_MSG_ERROR([*** --with-norew-tape is deprecated, use --with-tape-device instead.])
566 AC_ARG_WITH(changer-device,
567 [ --with-changer-device=ARG default tape changer device [[/dev/ch0 if it exists]]],
570 "" | y | ye | yes | n | no)
571 AC_MSG_ERROR([*** You must supply an argument to the --with-changer-device option.])
573 *) DEFAULT_CHANGER_DEVICE="$withval"
578 if test -z "$DEFAULT_CHANGER_DEVICE" &&
579 test -f /dev/ch0; then
580 DEFAULT_CHANGER_DEVICE=/dev/ch0
585 if test -z "$DEFAULT_CHANGER_DEVICE"; then
586 DEFAULT_CHANGER_DEVICE=/dev/null
589 AC_DEFINE_UNQUOTED(DEFAULT_CHANGER_DEVICE,"$DEFAULT_CHANGER_DEVICE",[This is the default changer device. ])
590 AC_SUBST(DEFAULT_CHANGER_DEVICE)
593 [ --with-fqdn use FQDN's to backup multiple networks],
599 y | ye | yes) AC_DEFINE(USE_FQDN,1,[Define for backups being done on a multiple networks and FQDNs are used. ])
601 *) AC_MSG_ERROR([*** You must not supply an argument to --with-fqdn option.])
605 AC_ARG_WITH(broken-fsf,
606 [ --with-broken-fsf only enable if tape fsf calls fail mid-file],
607 HAVE_BROKEN_FSF=$withval,
608 : ${HAVE_BROKEN_FSF=no}
610 case "$HAVE_BROKEN_FSF" in
612 y | ye | yes) AC_DEFINE(HAVE_BROKEN_FSF,1,[Define this if issuing a fsf on a tape fails when you are not at a tape
613 * mark, for instance, if amrecover gives I/O errors when skipping.
616 *) AC_MSG_ERROR([*** You must not supply an argument to --with-broken-fsf option.])
621 [ --with-gnutar[[=PROG]] use PROG as GNU tar executable [[default: looks for one]]],
624 /*) GNUTAR="$withval";;
627 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar]);;
632 AC_ARG_WITH(smbclient,
633 [ --with-smbclient[[=PROG]] use PROG as Samba's smbclient executable [[default: looks for one]]],
636 /*) SAMBA_CLIENT="$withval";;
638 n|no) SAMBA_CLIENT=;;
639 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-smbclient]);;
644 AC_ARG_WITH(samba-user,
645 [ --with-samba-user was deprecated],
646 [ AC_MSG_ERROR([*** The samba-user option was deprecated, the username go in the amandapass])
650 AC_ARG_WITH(gnutar-listdir,
651 [ --with-gnutar-listdir=DIR gnutar directory lists go in DIR [[localstatedir/amanda/gnutar-lists]]],
654 n | no) unset GNUTAR_LISTDIR ;;
655 y | ye | yes) : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;;
656 /*) GNUTAR_LISTDIR="$withval" ;;
657 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-gnutar-listdir])
660 : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"}
662 if test "$GNUTAR_LISTDIR"; then
664 test "x$prefix" = xNONE && prefix=$ac_default_prefix
665 eval echo "$GNUTAR_LISTDIR"
667 AC_DEFINE_UNQUOTED(GNUTAR_LISTED_INCREMENTAL_DIR,"$GNUTAR_LISTDIR",[The directory in which GNU tar should store directory lists for incrementals. ])
668 GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR
670 GNUTAR_LISTED_INCREMENTAL_DIRX=
672 AC_SUBST(GNUTAR_LISTED_INCREMENTAL_DIRX)
674 AC_ARG_WITH(gnutar-listed-incremental,
675 [ --with-gnutar-listed-incremental was deprecated, use --with-gnutar-listdir],
676 [ AC_MSG_ERROR([*** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead])
679 GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR
680 AC_SUBST(GNUTAR_LISTED_INCREMENTAL_DIR)
682 AC_ARG_WITH(bsd-security,
683 [ --without-bsd-security do not use BSD rsh/rlogin style security],
684 BSD_SECURITY=$withval,
685 : ${BSD_SECURITY=yes}
687 case "$BSD_SECURITY" in
689 y | ye | yes) AC_DEFINE(BSD_SECURITY,1,[Define to use BSD .rhosts/.amandahosts security. ])
691 *) AC_MSG_ERROR([*** You must not supply an argument to --with-bsd-security option.])
695 AC_ARG_WITH(amandahosts,
696 [ --without-amandahosts use .rhosts instead of .amandahosts],
697 USE_AMANDAHOSTS=$withval,
698 : ${USE_AMANDAHOSTS=yes}
700 case "$USE_AMANDAHOSTS" in
703 case "$BSD_SECURITY" in
704 y | ye | yes) AC_DEFINE(USE_AMANDAHOSTS,1,[Define if you want to use the .amandahosts for BSD security. ])
708 *) AC_MSG_ERROR([*** You must not supply an argument to --with-amandahosts option.])
712 dnl Specify --with-dbmalloc if you desire dbmalloc to be linked in
714 AC_ARG_WITH(dbmalloc,
715 [ --with-dbmalloc=DIR Location of dbmalloc libs and headers],
726 DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC"
727 DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc"
731 dnl Specify --with-krb4-security if Kerberos software is in somewhere
732 dnl other than the listed KRB4_SPOTS. We only compile kerberos support in
733 dnl if the right files are there.
735 : ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
737 AC_ARG_WITH(krb4-security,
738 [ --with-krb4-security=DIR Location of Kerberos software [[/usr/kerberos /usr/cygnus /usr /opt/kerberos]]],
739 KRB4_SECURITY="$withval",
740 : ${KRB4_SECURITY=no}
743 case "$KRB4_SECURITY" in
744 n | no) KRB4_SECURITY=no ;;
746 *) KRB4_SPOTS="$KRB4_SECURITY"
751 AC_MSG_CHECKING(for Kerberos and Amanda kerberos4 bits)
752 if test "x${KRB4_SECURITY}" = xyes -a -f ${srcdir-.}/common-src/krb4-security.c ; then
753 for dir in $KRB4_SPOTS; do
754 if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then
756 # This is the original Kerberos 4.
758 AC_MSG_RESULT(found in $dir)
760 AC_DEFINE(KRB4_SECURITY, 1, [Enable Kerberos security. ])
761 if test -d $dir/include/kerberosIV ; then
763 # This handles BSD/OS.
765 KRB4INCLUDES=-I$dir/include/kerberosIV
767 KRB4INCLUDES=-I$dir/include
769 KRB4LDFLAGS=-L$dir/lib
770 KRB4LIBS="-lkrb -ldes"
771 if test -f ${dir}/lib/libcom_err.a; then
772 KRB4LIBS="$KRB4LIBS -lcom_err"
775 elif test -f ${dir}/lib/libkrb4.a &&
776 test -f ${dir}/lib/libcrypto.a &&
777 test -f ${dir}/lib/libdes425.a ; then
779 # This is Kerberos 5 with Kerberos 4 back-support.
781 AC_MSG_RESULT(found in $dir)
783 AC_DEFINE(KRB4_SECURITY, 1, [Enable Kerberos security. ])
784 KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV"
785 KRB4LDFLAGS=-L$dir/lib
786 if test -f ${dir}/lib/libkrb5.a &&
787 test -f ${dir}/lib/libcom_err.a; then
788 KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err"
790 KRB4LIBS="-lkrb4 -lcrypto -ldes425"
796 if test "x$KRB4LDFLAGS" = "x" ; then
797 AC_MSG_RESULT(no libraries found)
803 AC_ARG_WITH(rsh-security,
804 [ --with-rsh-security use rsh as a transport],
805 RSH_SECURITY=$withval,
806 : ${RSH_SECURITY=yes}
808 case "$RSH_SECURITY" in
810 y | ye | yes) AC_DEFINE(RSH_SECURITY,1,[Define if RSH transport should be enabled. ])
812 *) AC_MSG_ERROR([*** You must not supply an argument the to --with-rsh-security option.])
816 AC_ARG_WITH(ssh-security,
817 [ --with-ssh-security use ssh as a transport],
818 SSH_SECURITY=$withval,
821 case "$SSH_SECURITY" in
823 y | ye | yes) AC_DEFINE(SSH_SECURITY,1,[Define if SSH transport should be enabled. ])
824 SSH_SECURITY_SET=true
826 *) AC_MSG_ERROR([*** You must not supply an argument the to --with-ssh-security option.])
830 AC_ARG_WITH(server-principal,
831 [ --with-server-principal=ARG server host principal [["amanda"]]],
834 "" | y | ye | yes | n | no)
835 AC_MSG_ERROR([*** You must supply an argument to the --with-server-principal option.])
838 SERVER_HOST_PRINCIPLE="$withval"
842 : ${SERVER_HOST_PRINCIPLE="amanda"}
844 AC_DEFINE_UNQUOTED(SERVER_HOST_PRINCIPLE,"$SERVER_HOST_PRINCIPLE",[The Kerberos server principle. ])
846 AC_ARG_WITH(server-instance,
847 [ --with-server-instance=ARG server host instance [["amanda"]]],
850 "" | y | ye | yes | n | no)
851 AC_MSG_ERROR([*** You must supply an argument to the --with-server-instance option.])
853 *) SERVER_HOST_INSTANCE="$withval"
857 : ${SERVER_HOST_INSTANCE="amanda"}
859 AC_DEFINE_UNQUOTED(SERVER_HOST_INSTANCE,"$SERVER_HOST_INSTANCE",[The Kerberos server instance. ])
861 AC_ARG_WITH(server-keyfile,
862 [ --with-server-keyfile=ARG server host key file [["/.amanda"]]],
865 "" | y | ye | yes | n | no)
866 AC_MSG_ERROR([*** You must supply an argument to the --with-server-keyfile option.])
868 *) SERVER_HOST_KEY_FILE="$withval"
872 : ${SERVER_HOST_KEY_FILE="/.amanda"}
874 AC_DEFINE_UNQUOTED(SERVER_HOST_KEY_FILE,"$SERVER_HOST_KEY_FILE",[The Kerberos server key file. ])
876 AC_ARG_WITH(client-principal,
877 [ --with-client-principal=ARG client host principal [["rcmd"]]],
880 "" | y | ye | yes | n | no)
881 AC_MSG_ERROR([*** You must supply an argument to the --with-client-principal option.])
883 *) CLIENT_HOST_PRINCIPLE="$withval"
887 : ${CLIENT_HOST_PRINCIPLE="rcmd"}
889 AC_DEFINE_UNQUOTED(CLIENT_HOST_PRINCIPLE,"$CLIENT_HOST_PRINCIPLE",[The Kerberos client host principle. ])
891 AC_ARG_WITH(client-instance,
892 [ --with-client-instance=ARG client host instance [[HOSTNAME_INSTANCE]]],
895 "" | y | ye | yes | n | no)
896 AC_MSG_ERROR([*** You must supply an argument to the --with-client-instance option.])
898 *) CLIENT_HOST_INSTANCE="$withval"
902 : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE}
904 AC_DEFINE_UNQUOTED(CLIENT_HOST_INSTANCE,$CLIENT_HOST_INSTANCE,[The Kerberos client host instance. ])
906 AC_ARG_WITH(client-keyfile,
907 [ --with-client-keyfile=ARG client host key file [[KEYFILE]]],
910 "" | y | ye | yes | n | no)
911 AC_MSG_ERROR([*** You must supply an argument to the --with-client-keyfile option.])
913 *) CLIENT_HOST_KEY_FILE="$withval"
917 : ${CLIENT_HOST_KEY_FILE=KEYFILE}
920 # Assume it's either KEYFILE (defined in krb.h), or a string filename...
921 if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
922 CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
925 AC_DEFINE_UNQUOTED(CLIENT_HOST_KEY_FILE,$CLIENT_HOST_KEY_FILE,[The Kerberos client host key file. ])
927 AC_ARG_WITH(ticket-lifetime,
928 [ --with-ticket-lifetime=ARG ticket lifetime [[128]]],
931 "" | y | ye | yes | n | no)
932 AC_MSG_ERROR([*** You must supply an argument to the --with-ticket-lifetime option.])
934 *) TICKET_LIFETIME="$withval"
938 : ${TICKET_LIFETIME=128}
940 AC_DEFINE_UNQUOTED(TICKET_LIFETIME,$TICKET_LIFETIME,[The Kerberos ticket lifetime. ])
942 dnl Specify --with-krb5-security if Kerberos software is in somewhere
943 dnl other than the listed KRB5_SPOTS. We only compile kerberos support in
944 dnl if the right files are there.
946 : ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
948 AC_ARG_WITH(krb5-security,
949 [ --with-krb5-security=DIR Location of Kerberos V software [[/usr/kerberos /usr/cygnus /usr /opt/kerberos]]],
950 KRB5_SECURITY="$withval",
951 : ${KRB5_SECURITY=no}
954 case "$KRB5_SECURITY" in
955 n | no) KRB5_SECURITY=no
959 *) KRB5_SPOTS="$KRB5_SECURITY"
964 # if found, force the static versions of these libs (.a) by linking directly
965 # with the .a files. I don't know how to get -R dependancies checked
966 # in autoconf at this time. -kashmir
967 AC_MSG_CHECKING(for Kerberos V)
970 for dir in $KRB5_SPOTS; do
972 if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then
973 if test -f ${k5libdir}/libcrypto.a; then
974 K5CRYPTO=${k5libdir}/libcrypto.a
975 elif test -f ${k5libdir}/libk5crypto.a; then
976 K5CRYPTO=${k5libdir}/libk5crypto.a
981 KRB5LIBS="${k5libdir}/libgssapi_krb5.a ${k5libdir}/libkrb5.a $K5CRYPTO ${k5libdir}/libcom_err.a"
984 elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then
986 KRB5LIBS="${k5libdir}/libgssapi.a ${k5libdir}/libkrb5.a ${k5libdir}/libasn1.a"
987 KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES"
992 if test "$KRB5_DIR_FOUND"; then
993 AC_MSG_RESULT(found in $KRB5_DIR_FOUND)
995 AC_DEFINE(KRB5_SECURITY,1,[Define if Kerberos 5 security is to be enabled. ])
997 # some OS's, such as NetBSD, stick krb5 includes out of the way...
998 # should probably just use autoconf to look for various include
999 # options and set them, but don't quite want to do that until I've
1000 # dug into it a bit more.
1002 if test -d "$KRB5_DIR_FOUND/krb5" ; then
1003 KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5"
1005 KRB5INCLUDES="-I$KRB5_DIR_FOUND/include"
1007 if test "$KRB5_CFLAGS" ; then
1008 KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS"
1010 KRB5LDFLAGS=-L$k5libdir
1014 if test "x$KRB5LDFLAGS" = "x" ; then
1015 AC_MSG_RESULT(no krb5 system libraries found)
1019 AC_ARG_WITH(portrange,
1020 [ --with-portrange=low,high bind unreserved TCP server sockets to ports within this range [[unlimited]]],
1022 TCPPORTRANGE="$withval"
1025 AC_ARG_WITH(tcpportrange,
1026 [ --with-tcpportrange=low,high bind unreserved TCP server sockets to ports within this range [[unlimited]]],
1028 TCPPORTRANGE="$withval"
1031 if test x"${TCPPORTRANGE+set}" = x"set"; then
1032 if test x`echo "$TCPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
1033 AC_MSG_ERROR([*** --with-tcpportrange requires two comma-separated positive numbers])
1035 min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'`
1036 max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'`
1037 if test $min_tcp_port -gt $max_tcp_port; then
1038 AC_MSG_ERROR([*** the second TCP port number must be greater than the first in --with-tcpportrange])
1040 if test $min_tcp_port -lt 1024; then
1041 AC_MSG_WARN([*** the TCP port range should be 1024 or greater in --with-tcpportrange])
1043 if test $max_tcp_port -ge 65536; then
1044 AC_MSG_WARN([*** the TCP port range should be less than 65536 in --with-tcpportrange])
1046 AC_DEFINE_UNQUOTED(TCPPORTRANGE,$TCPPORTRANGE,[A comma-separated list of two integers, determining the minimum and
1047 maximum unreserved TCP port numbers sockets should be bound to. ])
1050 AC_ARG_WITH(udpportrange,
1051 [ --with-udpportrange=low,high bind reserved UDP server sockets to ports within this range [[unlimited]]],
1053 UDPPORTRANGE="$withval"
1056 if test x"${UDPPORTRANGE+set}" = x"set"; then
1057 if test x`echo "$UDPPORTRANGE" | sed 's/[[0-9]][[0-9]]*,[[0-9]][[0-9]]*//'` != x""; then
1058 AC_MSG_ERROR([*** --with-udpportrange requires two comma-separated positive numbers])
1060 min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'`
1061 max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'`
1062 if test $min_udp_port -gt $max_udp_port; then
1063 AC_MSG_ERROR([*** the second UDP port number must be greater than the first in --with-udpportrange])
1065 if test $max_udp_port -ge 1024; then
1066 AC_MSG_WARN([*** the UDP port range should be less than 1024 in --with-udpportrange])
1068 if test $min_udp_port -le 0; then
1069 AC_MSG_WARN([*** the UDP port range should be greater than 0 in --with-udpportrange])
1071 AC_DEFINE_UNQUOTED(UDPPORTRANGE,$UDPPORTRANGE,[A comma-separated list of two integers, determining the minimum and
1072 maximum reserved UDP port numbers sockets should be bound to. ])
1075 AC_ARG_WITH(maxtapeblocksize,
1076 [ --with-maxtapeblocksize=kb Maximum size of a tape block],
1078 MAXTAPEBLOCKSIZE="$withval"
1080 : ${MAXTAPEBLOCKSIZE=32}
1083 AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE),[Maximum size of a tape block in KBytes.])
1084 AC_SUBST(MAXTAPEBLOCKSIZE)
1087 [ --with-db={text,db,dbm,gdbm,ndbm} use the selected database format [[text]]],
1090 "" | y | ye | yes | n | no)
1091 AC_MSG_ERROR([*** You must supply an argument to the --with-db option.])
1093 *) DB_STYLE="$withval"
1098 if test "$DB_STYLE"; then
1100 db | dbm | gdbm | ndbm | text) ;;
1102 AC_MSG_ERROR([*** Unknown argument $DB_STYLE given to --with-db. Choose from db, dbm, gdbm, ndbm, text.])
1109 [ --with-mmap force use of mmap instead of shared memory support],
1110 FORCE_MMAP=$withval,
1113 case "$FORCE_MMAP" in
1114 y | ye | yes | n | no) : ;;
1115 *) AC_MSG_ERROR([*** You must not supply an argument to --with-mmap.])
1119 AC_ARG_WITH(buffered-dump,
1120 [ --with-buffered-dump buffer the dumping sockets on the server for speed],
1121 DUMPER_SOCKET_BUFFERING=$withval,
1122 : ${DUMPER_SOCKET_BUFFERING=no}
1124 case "$DUMPER_SOCKET_BUFFERING" in
1127 y | ye | yes) AC_DEFINE(DUMPER_SOCKET_BUFFERING,1,[Define if dumper should buffer the sockets for faster throughput. ])
1129 *) AC_MSG_ERROR([*** You must not supply an argument to --with-buffered-dump.])
1133 AC_ARG_WITH(assertions,
1134 [ --with-assertions compile assertions into code],
1135 ASSERTIONS="$withval",
1138 case "$ASSERTIONS" in
1140 y | ye | yes) AC_DEFINE(ASSERTIONS,1,[Define if you want assertion checking. ])
1142 *) AC_MSG_ERROR([*** You must not supply an argument to --with-assertions option.])
1147 [ --with-tmpdir[=/temp/dir] area Amanda can use for temp files [[/tmp/amanda]]],
1152 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1153 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1157 n | no) AC_MSG_ERROR([*** --without-tmpdir is not allowed.]);;
1159 AMANDA_TMPDIR="/tmp/amanda";;
1161 AMANDA_TMPDIR="$tmpdir";;
1162 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-tmpdir option.]);;
1164 AC_DEFINE_UNQUOTED(AMANDA_TMPDIR,"$AMANDA_TMPDIR",[The directory in which Amanda should create temporary files. ])
1165 AC_SUBST(AMANDA_TMPDIR)
1167 AC_ARG_WITH(debugging,
1168 [ --with[[out]]-debugging[[=/debug/dir]] [[do not]] record runtime debugging information in specified directory [[--with-tmpdir]]],
1169 debugging="$withval",
1173 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1174 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1175 eval echo "$debugging"
1177 case "$debugging" in
1178 n | no) AMANDA_DBGDIR="";;
1179 y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
1180 /*) AMANDA_DBGDIR="$debugging";;
1181 *) AC_MSG_ERROR([*** You must supply a full pathname to --with-debugging option.])
1184 case "$AMANDA_DBGDIR" in
1186 *) AC_DEFINE(DEBUG_CODE,1,[Define if you want debugging. ])
1187 AC_DEFINE_UNQUOTED(AMANDA_DBGDIR,"$AMANDA_DBGDIR",[Location of Amanda directories and files. ])
1188 AC_SUBST(AMANDA_DBGDIR);;
1191 AC_ARG_WITH(debug_days,
1192 [ --with-debug-days=NN number of days to keep debugging files [[default=4]]],
1193 debug_days="$withval",
1196 case "$debug_days" in
1197 n | no) AMANDA_DEBUG_DAYS=0 ;;
1198 y | ye | yes) AMANDA_DEBUG_DAYS=4 ;;
1199 [[0-9]] | [[0-9]][[0-9]] | [[0-9]][[0-9]][[0-9]]) AMANDA_DEBUG_DAYS="$debug_days" ;;
1200 *) AC_MSG_ERROR([*** --with-debug-days value not numeric or out of range.])
1203 AC_DEFINE_UNQUOTED(AMANDA_DEBUG_DAYS,$AMANDA_DEBUG_DAYS,[Number of days to keep debugging files. ])
1204 AC_SUBST(AMANDA_DEBUG_DAYS)
1206 AC_ARG_WITH(testing,
1207 [ --with-testing[[=suffix]] use alternate service names],
1212 n | no) SERVICE_SUFFIX="";;
1213 y | ye | yes) SERVICE_SUFFIX="-test";;
1214 *) SERVICE_SUFFIX="-$TESTING";;
1216 AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
1217 KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
1218 AC_SUBST(SERVICE_SUFFIX)
1219 AC_DEFINE_UNQUOTED(SERVICE_SUFFIX, "$SERVICE_SUFFIX",[A suffix that will be appended to service names.
1220 * Useful for testing in parallel with a working version. ])
1221 AC_DEFINE_UNQUOTED(AMANDA_SERVICE_NAME, "$AMANDA_SERVICE_NAME", [The name for the Amanda service. ])
1222 AC_DEFINE_UNQUOTED(KAMANDA_SERVICE_NAME, "$KAMANDA_SERVICE_NAME", [The name for the Kerberized Amanda service. ])
1225 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1226 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1228 tmp=`eval echo "$bindir"`
1229 AC_DEFINE_UNQUOTED(bindir,"$tmp",[Directory in which user binaries should be installed. ])
1231 tmp=`eval echo "$sbindir"`
1232 AC_DEFINE_UNQUOTED(sbindir,"$tmp",[Directory in which administrator binaries should be installed. ])
1234 tmp=`eval echo "$libexecdir"`
1235 AC_DEFINE_UNQUOTED(libexecdir,"$tmp",[Directory in which internal binaries should be installed. ])
1237 tmp=`eval echo $mandir`
1238 AC_DEFINE_UNQUOTED(mandir,"$tmp",[Directory in which man-pages should be installed])
1245 dnl Set the order of dump programs to look for. Finding the proper file
1246 dnl system dumping program is problematic. Some systems, notably HP-UX
1247 dnl and AIX, have both the backup and dump programs. HP-UX can't use the
1248 dnl the backup program while AIX systems can't use the dump program. So
1249 dnl a variable is set up here to specify the order of dump programs to
1250 dnl search for on the system.
1251 DUMP_PROGRAMS="ufsdump dump backup"
1258 AC_DEFINE(STATFS_OSF1,1,[Define on OSF1. ])
1261 DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
1262 : ${USE_RUNDUMP=yes}
1273 GETCONF_LFS="XBS5_ILP32_OFFBIG"
1276 AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS"
1279 AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS"
1284 GETCONF_LFS="XBS5_ILP32_OFFBIG"
1285 DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
1286 AC_DEFINE(AIX_TAPEIO,1,[Define on AIX. ])
1287 AC_DEFINE(AIX_BACKUP,1,[Define on AIX. ])
1289 m88k-motorola-sysv4)
1306 dnl The old cc won't work!
1320 : ${USE_RUNDUMP=yes}
1321 AC_DEFINE(STATFS_ULTRIX,1,[Define on Ultrix. ])
1325 AC_DEFINE(UWARE_TAPEIO,1,[Define on UnixWare. ])
1333 AC_DEFINE(STATFS_SCO_OS5,1,[Define on SCO OS5. ])
1341 AC_DEFINE(IGNORE_TAR_ERRORS,1,[Define on Cygwin. ])
1342 # Cygwin needs PATH to find cygwin1.dll
1343 AC_DEFINE(NEED_PATH_ENV,1,[Define on Cygwin. ])
1344 AC_DEFINE(IGNORE_UID_CHECK,1,[Define on Cygwin. ])
1345 AC_DEFINE(IGNORE_FSTAB,1,[Define on Cygwin. ])
1346 AC_DEFINE(DONT_SUID_ROOT,1,[Define on Cygwin. ])
1347 NEED_SETUID_CLIENT=false
1348 NEED_RUNTIME_PSEUDO_RELOC=true
1354 This machine, target type $target, is not known
1355 to be fully supported by this configure script. If the
1356 installation of Amanda on this system succeeds or needed
1357 any patches, please email amanda-hackers@amanda.org with
1358 the patches or an indication of the sucess or failure of
1359 the Amanda installation on your system.
1366 if test -n "$dump_returns_1"; then
1367 AC_DEFINE(DUMP_RETURNS_1,1,[Define this if this system's dump exits with 1 as a success code. ])
1370 if test -n "$xenix_tapeio"; then
1371 AC_DEFINE(XENIX_TAPEIO,1,[Define on XENIX/ISC. ])
1374 AMANDA_CFLAGS="$AMANDA_CFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCCFLAGS"
1375 AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCINCLUDES"
1376 AMANDA_LDFLAGS="$AMANDA_LDFLAGS $KRB4LDFLAGS $KRB5LDFLAGS"
1377 AMANDA_LIBS="$KRB4LIBS $KRB5LIBS $DBMALLOCLIBS $AMANDA_LIBS"
1378 CFLAGS="$CFLAGS $AMANDA_CFLAGS"
1379 CPPFLAGS="$CPPFLAGS $AMANDA_CPPFLAGS"
1380 LDFLAGS="$LDFLAGS $AMANDA_LDFLAGS"
1381 LIBS="$AMANDA_LIBS $LIBS"
1384 dnl This specifies the flag for mt that tells mt the proper tape drive
1386 : ${MT_FILE_FLAG="-f"}
1387 AC_SUBST(MT_FILE_FLAG)
1388 AC_DEFINE_UNQUOTED(MT_FILE_FLAG, "$MT_FILE_FLAG",[Defined to the switch to be used when invoking mt to specify the
1391 AX_CREATE_STDINT_H(common-src/amanda-int.h)
1393 dnl Check for programs.
1394 AC_PATH_PROGS(AR,ar,,$LOCSYSPATH)
1398 if test "x$amanda_cv_awk_var_assignment" = xno; then
1400 AC_MSG_WARN([*** Your $awk cannot do command line variable assignment. Amplot will not be installed.])
1404 AC_PATH_PROGS(CAT,cat,,$LOCSYSPATH)
1405 if test -z "$CAT"; then
1408 AC_PATH_PROGS(COMPRESS,compress,,$LOCSYSPATH)
1409 AC_PATH_PROGS(DD,dd,,$LOCSYSPATH)
1410 AC_PATH_PROGS(EGREP,egrep,,$LOCSYSPATH)
1411 AC_PATH_PROGS(GETCONF,getconf,,$SYSPATH)
1413 AC_PATH_PROGS(GNUPLOT,gnuplot,,$LOCSYSPATH)
1414 if test -z "$GNUPLOT"; then
1416 AC_MSG_WARN([*** You do not have gnuplot. Amplot will not be installed.])
1419 AC_PATH_PROGS(GREP,grep,,$LOCSYSPATH)
1420 if test -z "$GREP"; then
1423 AC_DEFINE_UNQUOTED(GREP,"$GREP",[Define the location of the grep program. ])
1425 AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
1426 if test ! -z "$GNUTAR"; then
1427 case "`\"$GNUTAR\" --version 2>&1`" in
1428 *GNU*tar* | *Free*paxutils* )
1429 AC_DEFINE_UNQUOTED(GNUTAR,"$GNUTAR",[Define to the location of Gnu tar. ])
1432 AC_MSG_WARN([*** $GNUTAR is not GNU tar, so it will not be used.])
1438 AC_PATH_PROGS(SAMBA_CLIENT,smbclient,,$LOCSYSPATH)
1439 if test ! -z "$SAMBA_CLIENT"; then
1440 case "`\"$SAMBA_CLIENT\" '\\\\not.a.host.name\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1`" in
1444 *"Connection to not.a.host.name failed"*)
1448 AC_MSG_WARN([*** $SAMBA_CLIENT does not seem to be smbclient, so it will not be used.])
1452 if test -n "$SAMBA_CLIENT"; then
1453 AC_DEFINE_UNQUOTED(SAMBA_CLIENT,"$SAMBA_CLIENT",[Define the location of smbclient for backing up Samba PC clients. ])
1454 AC_DEFINE_UNQUOTED(SAMBA_VERSION, $smbversion,
1455 [Not the actual samba version, just a number that should be increased whenever we start to rely on a new samba feature. ])
1459 AC_PATH_PROGS(GZIP,gzip,,$LOCSYSPATH)
1460 if test "$GZIP"; then
1461 AC_DEFINE(HAVE_GZIP,1,[Define if Amanda is using the gzip program. ])
1462 COMPRESS_PATH="$GZIP"
1463 COMPRESS_SUFFIX=".gz"
1464 COMPRESS_FAST_OPT="--fast"
1465 COMPRESS_BEST_OPT="--best"
1466 UNCOMPRESS_PATH="$GZIP"
1467 UNCOMPRESS_OPT="-dc"
1469 if test "$COMPRESS"; then
1470 COMPRESS_PATH="$COMPRESS"
1471 COMPRESS_SUFFIX=".Z"
1472 COMPRESS_FAST_OPT="-f"
1473 COMPRESS_BEST_OPT="-f"
1474 UNCOMPRESS_PATH="$COMPRESS"
1475 UNCOMPRESS_OPT="-dc"
1477 dnl If we have to use cat, we don't define COMPRESS_FAST_OPT,
1478 dnl COMPRESS_BEST_OPT, or UNCOMPRESS_OPT as "" since cat will look
1479 dnl look for a file by the name of "".
1480 AC_MSG_WARN([*** Cannot find either gzip or compress. Using cat. ***])
1481 COMPRESS_PATH="$CAT"
1483 COMPRESS_FAST_OPT=""
1484 COMPRESS_BEST_OPT=""
1485 UNCOMPRESS_PATH="$CAT"
1489 AC_DEFINE_UNQUOTED(COMPRESS_PATH,"$COMPRESS_PATH",[Define to the exact path to the gzip or the compress program. ])
1490 AC_DEFINE_UNQUOTED(COMPRESS_SUFFIX,"$COMPRESS_SUFFIX",[Define to the suffix for the COMPRESS_PATH compression program. ])
1491 AC_DEFINE_UNQUOTED(COMPRESS_FAST_OPT,"$COMPRESS_FAST_OPT",[Define as the command line option for fast compression. ])
1492 AC_DEFINE_UNQUOTED(COMPRESS_BEST_OPT,"$COMPRESS_BEST_OPT",[Define as the command line option for best compression. ])
1493 AC_DEFINE_UNQUOTED(UNCOMPRESS_PATH,"$UNCOMPRESS_PATH",[Define as the exact path to the gzip or compress command. ])
1494 AC_DEFINE_UNQUOTED(UNCOMPRESS_OPT,"$UNCOMPRESS_OPT",[Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. ])
1496 AC_PATH_PROGS(MAILER,Mail mailx mail)
1497 if test -z "$MAILER"; then
1498 if $NO_SERVER_MODE; then
1500 AC_MSG_WARN([*** WARNING: Amanda cannot send mail reports without these programs.])
1502 AC_MSG_ERROR([Set MAILER to some program that accepts -s subject user < message_file.])
1505 AC_DEFINE_UNQUOTED(MAILER,"$MAILER",[Define to a program that understands -s "subject" user < message_file])
1507 AC_PATH_PROGS(MT,mt,mt,$LOCSYSPATH)
1509 AC_PATH_PROGS(CHIO,chio,chio,$LOCSYSPATH)
1511 AC_PATH_PROGS(CHS,chs,chs,$LOCSYSPATH)
1513 AC_PATH_PROGS(MTX,mtx,mtx,$LOCSYSPATH)
1515 AC_PATH_PROGS(MCUTIL,mcutil,mcutil,$LOCSYSPATH)
1517 AC_PATH_PROGS(PRINT, lpr lp)
1518 if test ! -z "$PRINT"; then
1519 AC_DEFINE_UNQUOTED(LPRCMD, "$PRINT",[Command for starting printing jobs. ])
1520 AC_CACHE_CHECK([which flag to use to select a printer],
1521 amanda_cv_printer_flag, [
1522 amanda_cv_printer_flag=$PRINTER_FLAG
1524 lpr|*/lpr) amanda_cv_printer_flag="-P";;
1525 lp|*/lp) amanda_cv_printer_flag="-d";;
1528 if test ! -z "$amanda_cv_printer_flag"; then
1529 AC_DEFINE_UNQUOTED(LPRFLAG, "$amanda_cv_printer_flag",[LPRCMD switch for specifying a printer name. ])
1531 AC_MSG_WARN([*** WARNING: amanda will always print to the default printer])
1535 AC_PATH_PROGS(PCAT,pcat,,$LOCSYSPATH)
1536 AC_PATH_PROGS(PERL,perl5 perl,,$LOCSYSPATH)
1538 dnl AC_PATH_PROGS(MAKEINFO,makeinfo,,$LOCSYSPATH)
1539 dnl AC_PATH_PROGS(TEXI2DVI,texi2dvi,,$LOCSYSPATH)
1541 AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH)
1542 AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH)
1543 if test "$DUMP" -a "$RESTORE"; then
1544 AC_DEFINE_UNQUOTED(DUMP,"$DUMP",[Define the location of the ufsdump, backup, or dump program. ])
1545 AC_DEFINE_UNQUOTED(RESTORE,"$RESTORE",[Define the location of the ufsrestore or restore program. ])
1546 if test -x $DUMP; then
1548 [whether $DUMP supports -E or -S for estimates],
1549 amanda_cv_dump_estimate,
1553 AC_TRY_COMMAND($DUMP 9Ef /dev/null /dev/null/invalid/fs 2>&1
1556 | $GREP -v Label >conftest.d-E 2>&1)
1557 cat conftest.d-E >&AS_MESSAGE_LOG_FD()
1558 AC_TRY_COMMAND($DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1
1561 | $GREP -v Label >conftest.d-S 2>&1)
1562 cat conftest.d-S >&AS_MESSAGE_LOG_FD()
1563 AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
1566 | $GREP -v Label >conftest.d 2>&1)
1567 cat conftest.d >&AS_MESSAGE_LOG_FD()
1568 if AC_TRY_COMMAND(cmp conftest.d-E conftest.d 1>&2); then
1569 amanda_cv_dump_estimate=E
1570 elif AC_TRY_COMMAND(cmp conftest.d-S conftest.d 1>&2); then
1571 amanda_cv_dump_estimate=S
1573 amanda_cv_dump_estimate=no
1575 rm -f conftest.d conftest.d-E conftest.d-S
1577 *) amanda_cv_dump_estimate=no
1582 AC_MSG_WARN([*** $DUMP is not executable, cannot run -E/-S test])
1583 amanda_cv_dump_estimate=no
1585 if test "x$amanda_cv_dump_estimate" != xno; then
1586 AC_DEFINE_UNQUOTED(HAVE_DUMP_ESTIMATE, "$amanda_cv_dump_estimate",[Define to the string that enables dump estimates. ])
1589 AC_ARG_WITH(dump-honor-nodump,
1590 [ --with-dump-honor-nodump if dump supports -h, use it for level0s too],
1591 [ if test -x $DUMP; then
1593 [whether $DUMP supports -h (honor nodump flag)],
1594 amanda_cv_honor_nodump,
1598 AC_TRY_COMMAND($DUMP 9hf 0 /dev/null /dev/null/invalid/fs 2>&1
1601 | $GREP -v Label >conftest.d-h 2>&1)
1602 cat conftest.d-h >&AS_MESSAGE_LOG_FD()
1603 AC_TRY_COMMAND($DUMP 9f /dev/null /dev/null/invalid/fs 2>&1
1606 | $GREP -v Label >conftest.d 2>&1)
1607 cat conftest.d >&AS_MESSAGE_LOG_FD()
1608 if AC_TRY_COMMAND(diff conftest.d-h conftest.d 1>&2); then
1609 amanda_cv_honor_nodump=yes
1611 amanda_cv_honor_nodump=no
1613 rm -f conftest.d conftest.d-h
1615 *) amanda_cv_honor_nodump=no
1620 AC_MSG_WARN([*** $DUMP is not executable, cannot run -h test])
1621 amanda_cv_honor_nodump=no
1623 if test "x$amanda_cv_honor_nodump" = xyes; then
1624 AC_DEFINE(HAVE_HONOR_NODUMP,1,[Define this if dump accepts -h for honoring nodump. ])
1629 AC_PATH_PROGS(XFSDUMP,xfsdump,,$SYSLOCPATH)
1630 AC_PATH_PROGS(XFSRESTORE,xfsrestore,,$SYSLOCPATH)
1631 if test "$XFSDUMP" -a "$XFSRESTORE"; then
1632 AC_DEFINE_UNQUOTED(XFSDUMP,"$XFSDUMP",[Define the location of the xfsdump program on Irix hosts. ])
1633 AC_DEFINE_UNQUOTED(XFSRESTORE,"$XFSRESTORE",[Define the location of the xfsrestore program on Irix hosts. ])
1634 AC_MSG_WARN([*** xfsdump causes the setuid-root rundump program to be enabled])
1635 AC_MSG_WARN([[*** to disable it, just #undef XFSDUMP in config/config.h]])
1638 VXSYSLOCPATH="$SYSLOCPATH:/usr/lib/fs/vxfs"
1639 AC_PATH_PROGS(VXDUMP,vxdump,,$VXSYSLOCPATH)
1640 AC_PATH_PROGS(VXRESTORE,vxrestore,,$VXSYSLOCPATH)
1641 if test "$VXDUMP" -a "$VXRESTORE"; then
1642 AC_DEFINE_UNQUOTED(VXDUMP,"$VXDUMP",[Define the location of the vxdump program on HPUX and SINIX hosts or on
1643 * other hosts where the Veritas filesystem (vxfs) has been installed. ])
1644 AC_DEFINE_UNQUOTED(VXRESTORE,"$VXRESTORE",[Define the location of the vxrestore program on HPUX and SINIX hosts or on
1645 * other hosts where the Veritas filesystem (vxfs) has been installed. ])
1648 AC_PATH_PROGS(VDUMP,vdump,,$SYSLOCPATH)
1649 AC_PATH_PROGS(VRESTORE,vrestore,,$SYSLOCPATH)
1650 if test "$VDUMP" -a "$VRESTORE"; then
1651 AC_DEFINE_UNQUOTED(VDUMP,"$VDUMP",[Define the location of the vdump program. ])
1652 AC_DEFINE_UNQUOTED(VRESTORE,"$VRESTORE",[Define the location of the vrestore program. ])
1655 dnl Handle all of the substitutions to make amplot work.
1656 if test "$PCAT"; then
1657 AMPLOT_CAT_PACK="if(o==\"z\")print \"$PCAT\"; else"
1661 if test "$COMPRESS"; then
1662 AMPLOT_COMPRESS=$COMPRESS
1663 AMPLOT_CAT_COMPRESS="if(o==\"Z\")print \"$COMPRESS -dc\"; else"
1665 AMPLOT_CAT_COMPRESS=
1667 if test "$GZIP"; then
1668 AMPLOT_COMPRESS=$GZIP
1669 AMPLOT_CAT_GZIP="if(o==\"gz\")print \"$GZIP -dc\"; else"
1673 AC_SUBST(AMPLOT_COMPRESS)
1674 AC_SUBST(AMPLOT_CAT_GZIP)
1675 AC_SUBST(AMPLOT_CAT_COMPRESS)
1676 AC_SUBST(AMPLOT_CAT_PACK)
1678 # Determine the printf format characters to use when printing
1679 # values of type long long. This will normally be "ll", but where
1680 # the compiler treats "long long" as a alias for "long" and printf
1681 # doesn't know about "long long" use "l". Hopefully the sprintf
1682 # will produce a inconsistant result in the later case. If the compiler
1683 # fails due to seeing "%lld" we fall back to "l".
1685 # Win32 uses "%I64d", but that's defined elsewhere since we don't use
1686 # configure on Win32.
1688 AC_MSG_CHECKING(printf format modifier for 64-bit integers)
1692 long long int j = 0;
1695 sprintf(buf, "%lld", j);
1696 exit((sizeof(long long int) != sizeof(long int))? 0 :
1697 (strcmp(buf, "0") != 0));
1704 [AC_MSG_RESULT(assuming target platform uses ll)
1706 AC_DEFINE_UNQUOTED(LL_FMT,"$LL_FMT",
1707 [Format for a long long printf. ])
1710 dnl Empty GZIP so that make dist works.
1713 dnl Checks for compilers, typedefs, structures, and compiler characteristics.
1714 dnl Check for large file compilation environment.
1717 [for large file compilation CFLAGS],
1718 amanda_cv_LFS_CFLAGS,
1720 amanda_cv_LFS_CFLAGS=
1721 if test "$GETCONF"; then
1722 if $GETCONF ${GETCONF_LFS}_CFLAGS >/dev/null 2>&1; then
1723 amanda_cv_LFS_CFLAGS=`$GETCONF ${GETCONF_LFS}_CFLAGS 2>/dev/null`
1730 [for large file compilation LDFLAGS],
1731 amanda_cv_LFS_LDFLAGS,
1733 amanda_cv_LFS_LDFLAGS=
1734 if test "$GETCONF"; then
1735 if $GETCONF ${GETCONF_LFS}_LDFLAGS >/dev/null 2>&1; then
1736 amanda_cv_LFS_LDFLAGS=`$GETCONF ${GETCONF_LFS}_LDFLAGS 2>/dev/null`
1743 [for large file compilation LIBS],
1747 if test "$GETCONF"; then
1748 if $GETCONF ${GETCONF_LFS}_LIBS >/dev/null 2>&1; then
1749 amanda_cv_LFS_LIBS=`$GETCONF ${GETCONF_LFS}_LIBS 2>/dev/null`
1755 if test "x$need_resetofs" = xyes; then
1756 AC_DEFINE(NEED_RESETOFS,1,[Define if we have to reset tape offsets when reacing 2GB. ])
1758 CFLAGS="$amanda_cv_LFS_CFLAGS $CFLAGS"
1759 CPPFLAGS="$amanda_cv_LFS_CFLAGS $CPPFLAGS"
1760 LDFLAGS="$amanda_cv_LFS_LDFLAGS $LDFLAGS"
1761 LIBS="$amanda_cv_LFS_LIBS $LIBS"
1763 AC_CHECK_SIZEOF(int)
1764 AC_CHECK_SIZEOF(long)
1765 AC_CHECK_SIZEOF(long long)
1766 AC_CHECK_SIZEOF(intmax_t)
1767 AC_CHECK_SIZEOF(off_t)
1770 AC_SUBST(LIBTOOL_DEPS)
1772 AC_PROG_GCC_TRADITIONAL
1775 AMANDA_C_UNSIGNED_LONG_CONSTANTS
1785 dnl AC_CHECK_TYPE does not work for socklen_t because it does not look
1786 dnl in <sys/socket.h>, so this is a variant that adds another header.
1787 AC_DEFUN([AMANDA_CHECK_TYPE],
1788 [AC_REQUIRE([AC_HEADER_STDC])dnl
1789 AC_MSG_CHECKING(for $1)
1790 AC_CACHE_VAL(ac_cv_type_$1,
1792 changequote(<<,>>)dnl
1793 <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
1794 changequote([,]), [#include <sys/types.h>
1799 #include <$3>], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
1800 AC_MSG_RESULT($ac_cv_type_$1)
1801 if test "x$ac_cv_type_$1" = xno; then
1802 AC_DEFINE($1, $2, [Define if $1 is not a standard system type])
1805 AMANDA_CHECK_TYPE(socklen_t, int, sys/socket.h)
1807 dnl Checks for header files.
1817 cam/scsi/scsi_message.h \
1833 netinet/in_systm.h \
1835 readline/history.h \
1836 readline/readline.h \
1856 sys/scsi/impl/uscsi.h \
1857 sys/scsi/scsi/ioctl.h \
1874 AC_CHECK_HEADERS(netinet/ip.h,,,
1875 [[#include <sys/socket.h>
1876 #if HAVE_SYS_TYPES_H
1877 #include <sys/types.h>
1879 #ifdef HAVE_NETINET_IN_SYSTM_H
1880 #include <netinet/in_systm.h>
1882 #include <netinet/in.h>
1885 AC_CHECK_HEADERS(sys/mount.h,,,
1886 [[#ifdef HAVE_SYS_PARAM_H
1887 #include <sys/param.h>
1891 NO_SCSI_CHANGER_MODE=true
1892 NO_CHIO_CHANGER_MODE=true
1899 if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
1900 AC_CACHE_CHECK([for HP/UX-like scsi changer support],
1901 amanda_cv_hpux_scsi_chio,
1902 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1903 #include <sys/scsi.h>
1905 static struct element_addresses changer_info;
1906 int i = SIOC_ELEMENT_ADDRESSES;
1907 int j = SIOC_ELEMENT_STATUS;
1908 int k = SIOC_MOVE_MEDIUM;
1909 ]])],[amanda_cv_hpux_scsi_chio=yes],[amanda_cv_hpux_scsi_chio=no])])
1910 if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then
1911 AC_DEFINE(HAVE_HPUX_SCSI_CHIO,1,[Define to enable HPUX chio based changer support. ])
1912 NO_SCSI_CHANGER_MODE=false
1917 dnl Linux SCSI based on ioctl
1919 if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
1920 test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then
1921 AC_CACHE_CHECK([for Linux like scsi support (ioctl)],
1922 amanda_cv_linux_scsi,
1923 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1924 #include <scsi/scsi_ioctl.h>
1925 #include <sys/mtio.h>
1929 ioctl(device, SCSI_IOCTL_SEND_COMMAND, Command);
1930 ]])],[amanda_cv_linux_scsi=yes],[amanda_cv_linux_scsi=no])])
1934 dnl Linux SCSI based on sg
1936 if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
1937 test x"$ac_cv_header_scsi_sg_h" = x"yes"; then
1938 AC_CACHE_CHECK([for Linux like scsi support (sg)],
1939 amanda_cv_linux_sg_scsi,
1940 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1941 #include <sys/types.h>
1942 #include <scsi/sg.h>
1943 #include <sys/mtio.h>
1946 struct sg_header *psg_header;
1948 write(device, buffer, 1);
1949 ]])],[amanda_cv_linux_sg_scsi=yes],[amanda_cv_linux_sg_scsi=no])])
1952 if test x"$amanda_cv_linux_scsi" = x"yes" ||
1953 test x"$amanda_cv_linux_sg_scsi" = x"yes";then
1954 AC_DEFINE(HAVE_LINUX_LIKE_SCSI,1,[Define to enable Linux tape-changer support.])
1955 NO_SCSI_CHANGER_MODE=false
1961 if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
1962 test x"$ac_cv_header_sys_scsi_h" = x"yes"; then
1963 AC_CACHE_CHECK([for HP-UX like scsi support],
1964 amanda_cv_hpux_scsi,
1965 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1967 #include <sys/ioctl.h>
1968 #include <sys/scsi.h>
1969 #include <sys/mtio.h>
1973 ioctl(device, SIOC_IO, Command);
1974 ]])],[amanda_cv_hpux_scsi=yes],[amanda_cv_hpux_scsi=no])])
1975 if test x"$amanda_cv_hpux_scsi" = x"yes";then
1976 AC_DEFINE(HAVE_HPUX_LIKE_SCSI,1,[Define to enable HPUX tape-changer support. ])
1977 NO_SCSI_CHANGER_MODE=false
1978 NO_CHIO_CHANGER_MODE=false
1985 if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
1986 test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then
1987 AC_CACHE_CHECK([for Irix like scsi support],
1988 amanda_cv_irix_scsi,
1989 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1990 #include <sys/types.h>
1991 #include <sys/dsreq.h>
1992 #include <sys/mtio.h>
1996 ioctl(device, DS_ENTER, &Command);
1997 ]])],[amanda_cv_irix_scsi=yes],[amanda_cv_irix_scsi=no])])
1998 if test x"$amanda_cv_irix_scsi" = x"yes";then
1999 AC_DEFINE(HAVE_IRIX_LIKE_SCSI,1,[Define to enable IRIX tape-changer support])
2000 NO_SCSI_CHANGER_MODE=false
2007 if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
2008 test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then
2009 AC_CACHE_CHECK([for Solaris-like scsi support],
2010 amanda_cv_solaris_scsi,
2011 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2012 #include <sys/types.h>
2013 #include <sys/scsi/impl/uscsi.h>
2014 #include <sys/mtio.h>
2018 ioctl(device, USCSICMD, Command);
2019 ]])],[amanda_cv_solaris_scsi=yes],[amanda_cv_solaris_scsi=no])])
2020 if test x"$amanda_cv_solaris_scsi" = x"yes";then
2021 AC_DEFINE(HAVE_SOLARIS_LIKE_SCSI,1,[Define to enable Solaris tape-changer support])
2022 NO_SCSI_CHANGER_MODE=false
2029 if test x"$ac_cv_header_sys_tape_h" = x"yes" &&
2030 test x"$ac_cv_header_sys_scarray_h" = x"yes" &&
2031 test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then
2032 AC_CACHE_CHECK([for AIX like scsi support],
2034 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2035 #include <sys/types.h>
2036 #include <sys/scarray.h>
2037 #include <sys/tape.h>
2041 ioctl(device, STIOCMD, Command);
2042 ]])],[amanda_cv_aix_scsi=yes],[amanda_cv_aix_scsi=no])])
2043 if test x"$amanda_cv_aix_scsi" = x"yes";then
2044 AC_DEFINE(HAVE_AIX_LIKE_SCSI,1,[Define to enable AIX tape-changer support])
2045 NO_SCSI_CHANGER_MODE=false
2051 if test x"$ac_cv_header_cam_cam_h" = x"yes";then
2052 AC_CACHE_CHECK([for CAM like scsi support],
2054 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2057 # include <cam/cam.h>
2058 # include <cam/cam_ccb.h>
2059 # include <cam/scsi/scsi_message.h>
2060 # include <cam/scsi/scsi_pass.h>
2061 # include <camlib.h>
2063 struct cam_device *curdev;
2065 curdev = cam_open_pass("", O_RDWR, NULL);
2066 ]])],[amanda_cv_cam_scsi=yes],[amanda_cv_cam_scsi=no])])
2067 if test x"$amanda_cv_cam_scsi" = x"yes";then
2068 AC_DEFINE(HAVE_CAM_LIKE_SCSI,1,[Define to enable CAM tape-changer support])
2069 NO_SCSI_CHANGER_MODE=false
2070 AC_CHECK_LIB(cam,main)
2078 if test x"$ac_cv_header_sys_mtio_h" = x"yes" &&
2079 test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then
2080 AC_CACHE_CHECK([for BSD like scsi support],
2082 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2083 #include <sys/types.h>
2084 #include <sys/scsiio.h>
2085 #include <sys/mtio.h>
2089 ioctl(device, SCIOCCOMMAND, &Command);
2090 ]])],[amanda_cv_bsd_scsi=yes],[amanda_cv_bsd_scsi=no])])
2091 if test x"$amanda_cv_bsd_scsi" = x"yes";then
2092 AC_DEFINE(HAVE_BSD_LIKE_SCSI,1,[Define to enable BSD tape-changer support])
2093 NO_SCSI_CHANGER_MODE=false
2097 dnl Do not build chg-scsi-chio if we cannot find the needed support
2098 dnl include files for the SCSI interfaces
2099 dnl chio.h and sys/chio.h are chio based systems
2100 if test x"$ac_cv_header_chio_h" = x"yes" ||
2101 test x"$ac_cv_header_sys_chio_h" = x"yes"; then
2102 dnl chg-scsi does not support FreeBSD 3.0's chio.h; it became backward
2103 dnl incompatible with the introduction of camlib.h
2104 if test x"$ac_cv_header_camlib_h" != x"yes"; then
2105 if $NO_SCSI_CHANGER_MODE; then
2106 NO_SCSI_CHANGER_MODE=false
2108 NO_CHIO_CHANGER_MODE=false
2113 dnl cur_colr is on some HP's
2114 AC_CHECK_LIB(cur_colr,main)
2116 AC_CHECK_LIB(intl,main)
2118 dnl Make sure we don't use -lnsl and -lsun on Irix systems.
2121 AC_CHECK_LIB(socket,main)
2124 AC_CHECK_LIB(resolv,main)
2125 AC_CHECK_LIB(nsl,main)
2126 AC_CHECK_LIB(socket,main)
2127 AC_CHECK_LIB(sun,main)
2131 AC_CHECK_LIB(termcap,tgetent)
2132 if test "x$ac_cv_lib_termcap_tgetent" != xyes; then
2133 AC_CHECK_LIB(curses,tgetent)
2134 if test "x$ac_cv_lib_curses_tgetent" != xyes; then
2135 AC_CHECK_LIB(ncurses,tgetent)
2138 if test "x$ac_cv_lib_termcap_tgetent" = xyes ||
2139 test "x$ac_cv_lib_curses_tgetent" = xyes ||
2140 test "x$ac_cv_lib_ncurses_tgetent" = xyes; then
2141 AC_CHECK_LIB(readline,readline,
2142 READLINE_LIBS="-lreadline"; AC_SUBST(READLINE_LIBS)
2144 if test "x$ac_cv_lib_readline_readline" != xyes; then
2145 AC_MSG_WARN([*** No readline library, no history and command line editing in amrecover!])
2148 AC_MSG_WARN([*** No terminal library, no history and command line editing in amrecover!])
2151 if test "x$ac_cv_header_linux_zftape_h" = xyes; then
2152 if test "x$ac_cv_header_vtblc_h" = xyes; then
2153 AC_CHECK_LIB(vtblc,main)
2154 if test "x$ac_cv_lib_vtblc_main" != xyes; then
2155 AC_MSG_WARN([*** vtblc library not found - no QIC volume table support!])
2158 AC_MSG_WARN([*** vtblc headers not found - no QIC volume table support!])
2162 AC_CHECK_LIB(m,modf)
2164 dnl Check for various "mt status" related structure elements.
2166 AC_MSG_CHECKING(for mt_flags mtget structure element)
2167 mt_flags_result="found"
2168 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2170 #include <sys/types.h>
2171 #include <sys/mtio.h>
2177 ]])],[AC_DEFINE(HAVE_MT_FLAGS,1,Define if the mtget structure has an mt_flags field)],[mt_flags_result="not found"])
2178 AC_MSG_RESULT($mt_flags_result)
2180 AC_MSG_CHECKING(for mt_fileno mtget structure element)
2181 mt_fileno_result="found"
2182 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2184 #include <sys/types.h>
2185 #include <sys/mtio.h>
2191 ]])],[AC_DEFINE(HAVE_MT_FILENO,1,Define if the mtget structure has an mt_fileno field)],[mt_fileno_result="not found"])
2192 AC_MSG_RESULT($mt_fileno_result)
2194 AC_MSG_CHECKING(for mt_blkno mtget structure element)
2195 mt_blkno_result="found"
2196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2198 #include <sys/types.h>
2199 #include <sys/mtio.h>
2205 ]])],[AC_DEFINE(HAVE_MT_BLKNO,1,Define if the mtget structure has an mt_blkno field)],[mt_blkno_result="not found"])
2206 AC_MSG_RESULT($mt_blkno_result)
2208 AC_MSG_CHECKING(for mt_dsreg mtget structure element)
2209 mt_dsreg_result="found"
2210 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2212 #include <sys/types.h>
2213 #include <sys/mtio.h>
2219 ]])],[AC_DEFINE(HAVE_MT_DSREG,1,Define if the mtget structure has an mt_dsreg field)],[mt_dsreg_result="not found"])
2220 AC_MSG_RESULT($mt_dsreg_result)
2222 AC_MSG_CHECKING(for mt_erreg mtget structure element)
2223 mt_erreg_result="found"
2224 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2226 #include <sys/types.h>
2227 #include <sys/mtio.h>
2233 ]])],[AC_DEFINE(HAVE_MT_ERREG,1,Define if the mtget structure has an mt_erreg field)],[mt_erreg_result="not found"])
2234 AC_MSG_RESULT($mt_erreg_result)
2238 dnl Check if the system does support the user requested database library.
2239 dnl Begin by checking for the header file. If it is not there, then do
2240 dnl not use the library. If the header file is there, then try to link
2241 dnl against the library. If it's not there, then try to link using
2242 dnl just the -lc library. If the link against -lc fails, then do not
2243 dnl use this library.
2247 dnl Testing if libc contains the dbm_open routine is tested for a
2248 dnl lot of times below. We do it once here now.
2250 AC_CHECK_LIB(c,dbm_open)
2255 if test "x$ac_cv_header_db_h" = xyes; then
2256 AC_CHECK_LIB(db,main)
2257 if test "x$ac_cv_lib_db_main" = xyes; then
2258 AC_CHECK_LIB(db,dbm_open)
2259 if test "x$ac_cv_lib_db_dbm_open" = xyes; then
2264 AC_MSG_WARN([*** db database library requested but dbm_open not found in -ldb.])
2267 if test "x$ac_cv_lib_c_dbm_open" = xyes; then
2272 AC_MSG_WARN([*** db library requested but -ldb doesn't exist and dbm_open cannot be found.])
2277 AC_MSG_WARN([*** db database library requested but db.h not found.])
2282 if test "x$ac_cv_header_dbm_h" = xyes; then
2283 AC_CHECK_LIB(dbm,main)
2284 if test "x$ac_cv_lib_dbm_main" = xyes; then
2285 AC_CHECK_LIB(dbm,dbm_open)
2286 if test "x$ac_cv_lib_dbm_dbm_open" = xyes; then
2291 AC_MSG_WARN([*** dbm database library requested but dbm_open not found in -ldbm.])
2294 if test "x$ac_cv_lib_c_dbm_open" = xyes; then
2299 AC_MSG_WARN([*** dbm library requested but -ldbm doesn't exist and dbm_open cannot be found.])
2304 AC_MSG_WARN([*** dbm database library requested but dbm.h not found.])
2309 if test "x$ac_cv_header_ndbm_h" = xyes; then
2310 AC_CHECK_LIB(gdbm,main)
2311 if test "x$ac_cv_lib_gdbm_main" = xyes; then
2312 AC_CHECK_LIB(gdbm,dbm_open)
2313 if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then
2318 AC_MSG_WARN([*** gdbm database library requested but -lgdbm not found.])
2321 if test "x$ac_cv_lib_c_dbm_open" = xyes; then
2326 AC_MSG_WARN([*** gdbm library requested but -lgdbm doesn't exist and dbm_open cannot be found.])
2331 AC_MSG_WARN([*** gdbm database library requested but ndbm.h not found.])
2336 if test "x$ac_cv_header_ndbm_h" = xyes; then
2337 AC_CHECK_LIB(ndbm,main)
2338 if test "x$ac_cv_lib_ndbm_main" = xyes; then
2339 AC_CHECK_LIB(ndbm,dbm_open)
2340 if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then
2345 AC_MSG_WARN([*** ndbm database library requested but -lndbm not found.])
2348 if test "x$ac_cv_lib_c_dbm_open" = xyes; then
2353 AC_MSG_WARN([*** ndbm library requested but -lndbm doesn't exist and dbm_open cannot be found.])
2358 AC_MSG_WARN([*** ndbm database library requested but ndbm.h not found.])
2367 dnl If a database style was not specified select an appropriate one
2369 dnl Nowadays we default to our own internal text database, but I have left
2370 dnl the code that does the testing here just in case it is needed one day.
2372 if test -z "$DB_STYLE"; then
2378 dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_ndbm_h" = xyes; then
2379 dnl AC_CHECK_LIB(ndbm,dbm_open)
2380 dnl if test "x$ac_cv_lib_ndbm_dbm_open" = xyes; then
2382 dnl DB_HEADER=ndbm.h
2384 dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
2386 dnl DB_HEADER=ndbm.h
2391 dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_db_h" = xyes; then
2392 dnl AC_CHECK_LIB(db,dbm_open)
2393 dnl if test "x$ac_cv_lib_db_dbm_open" = xyes; then
2397 dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
2404 dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_dbm_h" = xyes; then
2405 dnl AC_CHECK_LIB(dbm,dbm_open)
2406 dnl if test "x$ac_cv_lib_db_dbm_open" = xyes; then
2410 dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
2417 dnl if test -z "$DB_STYLE" -a "x$ac_cv_header_ndbm_h" = xyes; then
2418 dnl AC_CHECK_LIB(gdbm,dbm_open)
2419 dnl if test "x$ac_cv_lib_gdbm_dbm_open" = xyes; then
2421 dnl DB_HEADER=ndbm.h
2423 dnl elif test "x$ac_cv_lib_c_dbm_open" = xyes; then
2425 dnl DB_HEADER=ndbm.h
2430 dnl if test -z "$DB_STYLE"; then
2431 dnl if test "x$ac_cv_lib_c_dbm_open" = xyes; then
2432 dnl AC_MSG_WARN([*** A dbm_open() routine was found in -lc, but no header])
2433 dnl AC_MSG_WARN([*** files exist. Please remedy the situation.])
2435 dnl AC_MSG_WARN([*** No dbm_open() routine found!])
2437 dnl AC_MSG_WARN([*** You may want to install the gdbm library from])
2438 dnl AC_MSG_WARN([*** ftp://prep.ai.mit.edu/pub/gnu/gdbm-1.7.3.tar.gz.])
2440 dnl AC_MSG_WARN([*** Using the built-in text database.])
2446 if test "x$DB_STYLE" = xtext; then
2447 AC_DEFINE(TEXTDB,1,[Define to enable the text-based database format. ])
2449 AC_MSG_CHECKING([for database])
2450 AC_MSG_RESULT([header is $DB_HEADER, linking against -l$DB_LIB])
2452 db) AC_DEFINE(USE_DB_H,1,[Define to enable db databases. ]) ;;
2453 dbm) AC_DEFINE(USE_DBM_H,1,[Define to enable dbm databases. ]) ;;
2454 gdbm) AC_DEFINE(USE_GDBM_H,1,[Define to enable gdbm databases. ]) ;;
2455 ndbm) AC_DEFINE(USE_NDBM_H,1,[Define to enable ndbm databases. ]) ;;
2459 [for struct datum declared in header files],
2460 amanda_cv_struct_datum,
2462 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2463 #if defined(USE_DB_H)
2466 # if defined(USE_DBM_H)
2469 # if defined(USE_NDBM_H)
2476 ]])],[amanda_cv_struct_datum=yes],[amanda_cv_struct_datum=no
2479 if test "x$amanda_cv_struct_datum" = xyes; then
2480 AC_DEFINE(HAVE_STRUCT_DATUM,1,[Define if the database header declares struct datum. ])
2487 dbm | ndbm) DB_EXT=".dir .pag";;
2493 AC_CACHE_CHECK(whether _POSIX2_RE_DUP_MAX is defined,
2494 amanda_cv_have__posix2_re_dup_max,
2497 #ifdef _POSIX2_RE_DUP_MAX
2500 ], amanda_cv_have__posix2_re_dup_max=yes, amanda_cv_have__posix2_re_dup_max=no))
2501 if test "x$amanda_cv_have__posix2_re_dup_max" = xyes; then
2502 AC_DEFINE(HAVE__POSIX2_RE_DUP_MAX,1,[Define if limits.h defines _POSIX2_RE_DUP_MAX. ])
2505 AC_CACHE_CHECK(whether CHAR_MIN is defined,
2506 amanda_cv_have_char_min,
2512 ], amanda_cv_have_char_min=yes, amanda_cv_have_char_min=no))
2513 if test "x$amanda_cv_have_char_min" = xyes; then
2514 AC_DEFINE(HAVE_CHAR_MIN,1,[Define if limits.h defines CHAR_MIN. ])
2517 AC_CACHE_CHECK(whether CHAR_MAX is defined,
2518 amanda_cv_have_char_max,
2524 ], amanda_cv_have_char_max=yes, amanda_cv_have_char_max=no))
2525 if test "x$amanda_cv_have_char_max" = xyes; then
2526 AC_DEFINE(HAVE_CHAR_MAX,1,[Define if limits.h defines CHAR_MAX. ])
2529 AC_CACHE_CHECK(whether CHAR_BIT is defined,
2530 amanda_cv_have_char_bit,
2536 ], amanda_cv_have_char_bit=yes, amanda_cv_have_char_bit=no))
2537 if test "x$amanda_cv_have_char_bit" = xyes; then
2538 AC_DEFINE(HAVE_CHAR_BIT,1,[Define if limits.h defines CHAR_BIT. ])
2541 dnl Checks for library functions and if the function is declared in
2542 dnl an appropriate header file. Add some of the missing functions
2544 ICE_CHECK_DECL(accept,sys/types.h sys/socket.h)
2546 AC_CHECK_FUNCS(atexit)
2547 ICE_CHECK_DECL(atof,stdlib.h)
2548 AC_CHECK_FUNCS(basename)
2549 ICE_CHECK_DECL(bind,sys/types.h sys/socket.h)
2550 ICE_CHECK_DECL(bcopy,string.h strings.h stdlib.h)
2551 ICE_CHECK_DECL(bzero,string.h strings.h stdlib.h)
2552 AC_FUNC_CLOSEDIR_VOID
2553 ICE_CHECK_DECL(closelog,syslog.h)
2554 ICE_CHECK_DECL(connect,sys/types.h sys/socket.h)
2555 ICE_CHECK_DECL(dbm_open,${DB_HEADER-no/db/header/file})
2556 AC_CHECK_FUNCS(endmntent)
2557 ICE_CHECK_DECL(fclose,stdio.h)
2558 ICE_CHECK_DECL(fflush,stdio.h)
2559 ICE_CHECK_DECL(flock,sys/file.h)
2560 ICE_CHECK_DECL(fprintf,stdio.h)
2561 ICE_CHECK_DECL(fputc,stdio.h)
2562 ICE_CHECK_DECL(fputs,stdio.h)
2563 ICE_CHECK_DECL(fread,stdio.h stdlib.h)
2564 ICE_CHECK_DECL(fseek,stdio.h)
2565 ICE_CHECK_DECL(fwrite,stdio.h stdlib.h)
2566 AC_REPLACE_FUNCS(getcwd)
2567 AC_CHECK_FUNCS(getfsent)
2568 ICE_CHECK_DECL(gethostname,unistd.h)
2570 ICE_CHECK_DECL(getopt,stdlib.h unistd.h libc.h)
2571 ICE_CHECK_DECL(getpeername,sys/types.h sys/socket.h)
2572 AC_CHECK_FUNCS(getpgrp)
2574 ICE_CHECK_DECL(getsockname,sys/types.h sys/socket.h)
2575 ICE_CHECK_DECL(getsockopt,sys/types.h sys/socket.h)
2576 ICE_CHECK_DECL(gettimeofday,time.h sys/time.h)
2577 AMANDA_FUNC_GETTIMEOFDAY_ARGS
2578 AC_CHECK_FUNCS(getvfsent initgroups isascii)
2579 ICE_CHECK_DECL(initgroups,grp.h sys/types.h unistd.h libc.h)
2580 ICE_CHECK_DECL(ioctl,sys/ioctl.h unistd.h libc.h)
2581 ICE_CHECK_DECL(listen,sys/types.h sys/socket.h)
2582 ICE_CHECK_DECL(lstat,sys/types.h sys/stat.h)
2583 ICE_CHECK_DECL(malloc,stdlib.h)
2584 AC_REPLACE_FUNCS(memmove)
2585 ICE_CHECK_DECL(memmove,string.h strings.h)
2586 ICE_CHECK_DECL(memset,string.h strings.h)
2587 AC_CHECK_FUNCS(mkdir)
2588 ICE_CHECK_DECL(mkstemp,stdlib.h)
2589 ICE_CHECK_DECL(mktemp,stdlib.h)
2590 AC_REPLACE_FUNCS(mktime)
2591 ICE_CHECK_DECL(mktime,time.h sys/time.h)
2593 dnl atexit() is prefered, sunos (maybe others?) define on_exit
2594 AC_CHECK_FUNCS(on_exit)
2595 ICE_CHECK_DECL(openlog,syslog.h)
2596 ICE_CHECK_DECL(pclose,stdio.h)
2597 ICE_CHECK_DECL(perror,stdio.h)
2598 ICE_CHECK_DECL(printf,stdio.h)
2599 AC_CHECK_FUNCS(putenv)
2600 ICE_CHECK_DECL(puts,stdio.h)
2601 ICE_CHECK_DECL(realloc,stdlib.h)
2602 ICE_CHECK_DECL(recvfrom,sys/types.h sys/socket.h)
2603 ICE_CHECK_DECL(remove,stdio.h)
2604 ICE_CHECK_DECL(rename,stdio.h)
2605 ICE_CHECK_DECL(rewind,stdio.h)
2606 AC_CHECK_FUNCS(rmdir)
2607 ICE_CHECK_DECL(ruserok,netdb.h sys/socket.h libc.h unistd.h)
2608 ICE_CHECK_DECL(select,sys/types.h sys/socket.h sys/select.h time.h sys/time.h)
2609 AMANDA_FUNC_SELECT_ARG_TYPE
2610 ICE_CHECK_DECL(sendto,sys/types.h sys/socket.h)
2611 ICE_CHECK_DECL(setegid,unistd.h)
2612 ICE_CHECK_DECL(seteuid,unistd.h)
2613 AC_CHECK_FUNCS(setmntent)
2614 AC_CHECK_FUNCS(shquote)
2616 ICE_CHECK_DECL(setresgid,unistd.h)
2617 ICE_CHECK_DECL(setresuid,unistd.h)
2619 dnl arguments for setpgrp or not
2620 AC_CHECK_FUNC(setpgid, [
2621 AC_DEFINE(HAVE_SETPGID,1,[Define if setpgid() is available. ])
2622 ICE_CHECK_DECL(setpgid,sys/types.h unistd.h)
2624 AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP])
2625 ICE_CHECK_DECL(setpgrp,sys/types.h unistd.h libc.h)
2627 ICE_CHECK_DECL(setsockopt,sys/types.h sys/socket.h)
2629 AC_CHECK_FUNCS(shmget,
2631 AMANDA_FUNC_SHM_ARG_TYPE
2632 case "$FORCE_MMAP" in
2634 AC_DEFINE(HAVE_SYSVSHM,1,[Define if SysV shared-memory functions are available. ])
2639 ICE_CHECK_DECL(shmat,sys/types.h sys/ipc.h sys/shm.h)
2640 ICE_CHECK_DECL(shmctl,sys/types.h sys/ipc.h sys/shm.h)
2641 ICE_CHECK_DECL(shmdt,sys/types.h sys/ipc.h sys/shm.h)
2642 ICE_CHECK_DECL(shmget,sys/types.h sys/ipc.h sys/shm.h)
2644 if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
2645 case "$FORCE_MMAP" in
2647 if test "x$ac_cv_func_shmget" != xyes; then
2648 AC_MSG_WARN([*** Neither shmget() nor mmap() found!])
2649 AC_MSG_WARN([*** This system will not support the Amanda server.])
2654 AC_MSG_WARN([*** --with-mmap used on a system with no mmap() support!])
2655 AC_MSG_WARN([*** This system will not support the Amanda server.])
2661 dnl Some systems have snprintf but not vsnprintf. If either snprintf or
2662 dnl vsnprintf are missing, then use the snprintf.c we provide.
2663 ICE_CHECK_DECL(snprintf,stdio.h)
2664 ICE_CHECK_DECL(vsnprintf,stdio.h)
2665 if test x"$ice_have_snprintf" != x"yes" ||
2666 test x"$ice_have_vsnprintf" != x"yes"; then
2667 AC_LIBOBJ([snprintf])
2669 dnl so that automake includes snprintf.c in the distribution
2670 AC_REPLACE_FUNCS(snprintf)
2674 AC_CHECK_FUNCS(sigaction sigemptyset sigvec)
2675 ICE_CHECK_DECL(socket,sys/types.h sys/socket.h)
2676 ICE_CHECK_DECL(socketpair,sys/types.h sys/socket.h)
2677 ICE_CHECK_DECL(sscanf,stdio.h)
2678 AC_CHECK_FUNCS(statfs statvfs)
2679 AC_REPLACE_FUNCS(strerror)
2680 ICE_CHECK_DECL(strerror,string.h strings.h)
2682 AC_REPLACE_FUNCS(strftime)
2683 ICE_CHECK_DECL(strftime,time.h sys/time.h)
2684 AC_REPLACE_FUNCS(strncasecmp)
2685 ICE_CHECK_DECL(strncasecmp,string.h strings.h)
2686 AC_REPLACE_FUNCS(strstr)
2687 ICE_CHECK_DECL(syslog,syslog.h)
2688 ICE_CHECK_DECL(system,stdlib.h)
2689 ICE_CHECK_DECL(time,time.h sys/time.h)
2690 ICE_CHECK_DECL(tolower,ctype.h)
2691 ICE_CHECK_DECL(toupper,ctype.h)
2692 ICE_CHECK_DECL(ungetc,stdio.h)
2694 ICE_CHECK_DECL(vfprintf,stdio.h stdlib.h)
2695 ICE_CHECK_DECL(vprintf,stdio.h stdlib.h)
2696 ICE_CHECK_DECL(vsprintf,stdio.h stdlib.h)
2697 AC_CHECK_FUNC(wait4)
2698 AC_REPLACE_FUNCS(waitpid)
2699 AC_REPLACE_FUNCS(writev)
2700 ICE_CHECK_DECL(writev, unistd.h sys/uio.h)
2701 AC_REPLACE_FUNCS(strcasecmp)
2702 ICE_CHECK_DECL(strcasecmp,string.h strings.h)
2704 AC_CHECK_FUNCS(fnmatch)
2708 dnl disk device prefixes
2709 AC_MSG_CHECKING(disk device prefixes)
2710 dnl Use df to find the mount point for the root filesystem. Use
2711 dnl the positional parameters to find the particular line from df
2712 dnl that contains the root paritition. We put it in a subshell so
2713 dnl that the original positional parameters are not messed with.
2715 df / | while read line; do
2717 while test $# -gt 0; do
2718 if test "x$1" = "x/"; then
2725 ) | sed 's/(//' | sed 's/)//' `
2727 dnl Search for the mount point by using expr to find the parameter
2731 while test $# -gt 0; do
2732 if expr "$1" : '.*dev' >/dev/null 2>&1; then
2740 if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then
2741 AC_MSG_RESULT((predefined) $DEV_PREFIX - $RDEV_PREFIX)
2743 if test -d /dev/dsk; then
2744 DEV_PREFIX=/dev/dsk/
2745 if test -d /dev/rdsk; then
2746 RDEV_PREFIX=/dev/rdsk/
2748 RDEV_PREFIX=/dev/dsk/
2750 elif test -d /dev; then
2753 dev_prefix=/dev/dsk/
2754 rdev_prefix=/dev/rdsk/
2755 AC_MSG_WARN("*** Run amsinixfixdevs on Sinix systems using VxFS.")
2760 # Some systems, notably Linux, do not have raw disk devices
2761 # names. Check this by trying to see if a raw disk device name
2762 # exists using the normal raw device path prepended to the
2763 # mount point of the root filesystem.
2764 if test "$mount"; then
2765 dev_name="/dev/r`basename $mount`"
2766 if test -b $dev_name -o -c $dev_name; then
2780 AC_MSG_RESULT($DEV_PREFIX - $RDEV_PREFIX)
2783 AC_DEFINE_UNQUOTED(DEV_PREFIX,"${DEV_PREFIX}",[Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ ])
2784 AC_DEFINE_UNQUOTED(RDEV_PREFIX,"${RDEV_PREFIX}",[Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ ])
2788 AC_MSG_WARN("*** Run amhpfixdevs on HP-UX systems using /dev/vg??.")
2792 dnl lock/flock/fcntl
2794 [whether posix fcntl locking works],
2795 amanda_cv_posix_filelocking,
2797 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2799 #define CONFIGURE_TEST
2800 #define USE_POSIX_FCNTL
2801 #include "${srcdir-.}/common-src/amflock.c"
2803 amanda_cv_posix_filelocking=yes
2805 amanda_cv_posix_filelocking="no"
2807 amanda_cv_posix_filelocking="no (cannot run test)"
2809 rm -f /tmp/conftest.lock
2811 if test "x$amanda_cv_posix_filelocking" = xyes; then
2812 AC_DEFINE(USE_POSIX_FCNTL,1,[Define to use Posix fcntl for file locking.])
2813 HAS_WORKING_FILE_LOCK=1
2816 if test -z "$HAS_WORKING_FILE_LOCK"; then
2818 [whether flock locking works],
2819 amanda_cv_flock_filelocking,
2821 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2823 #define CONFIGURE_TEST
2825 #include "${srcdir-.}/common-src/amflock.c"
2827 amanda_cv_flock_filelocking="yes"
2829 amanda_cv_flock_filelocking="no"
2831 amanda_cv_flock_filelocking="no (cannot run test)"
2833 rm -f /tmp/conftest.lock
2835 if test "x$amanda_cv_flock_filelocking" = xyes; then
2836 AC_DEFINE(USE_FLOCK,1,[Define to use flock for file locking.])
2837 HAS_WORKING_FILE_LOCK=1
2841 if test -z "$HAS_WORKING_FILE_LOCK"; then
2843 [whether lockf locking works],
2844 amanda_cv_lockf_filelocking,
2846 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2848 #define CONFIGURE_TEST
2850 #include "${srcdir-.}/common-src/amflock.c"
2852 amanda_cv_lockf_filelocking="yes"
2854 amanda_cv_lockf_filelocking="no"
2856 amanda_cv_lockf_filelocking="no (cannot run test)"
2858 rm -f /tmp/conftest.lock
2860 if test "x$amanda_cv_lockf_filelocking" = xyes; then
2861 AC_DEFINE(USE_LOCKF,1,[Define to use lockf for file locking.])
2862 HAS_WORKING_FILE_LOCK=1
2866 if test -z "$HAS_WORKING_FILE_LOCK"; then
2868 [whether lnlock locking works],
2869 amanda_cv_lnlock_filelocking,
2871 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2873 #define CONFIGURE_TEST
2875 #include "${srcdir-.}/common-src/amflock.c"
2876 #include "${srcdir-.}/common-src/alloc.c"
2877 #include "${srcdir-.}/common-src/error.c"
2878 #include "${srcdir-.}/common-src/snprintf.c"
2880 amanda_cv_lnlock_filelocking="yes"
2882 amanda_cv_lnlock_filelocking="no"
2884 amanda_cv_lnlock_filelocking="no (cannot run test)"
2886 rm -f /tmp/conftest.lock
2888 if test "x$amanda_cv_lnlock_filelocking" = xyes; then
2889 AC_DEFINE(USE_LNLOCK,1,[Define to use a hard-link based approach for file locking.])
2890 HAS_WORKING_FILE_LOCK=1
2894 if test -z "$HAS_WORKING_FILE_LOCK"; then
2895 AC_MSG_WARN([*** No working file locking capability found!])
2896 AC_MSG_WARN([*** Be VERY VERY careful.])
2899 dnl extra substitution parameters
2906 AM_CONDITIONAL(WANT_CLIENT, test x"$NO_CLIENT_MODE" != x"true")
2907 AM_CONDITIONAL(WANT_SAMBA, test ! -z "$SAMBA_CLIENT")
2908 AM_CONDITIONAL(WANT_RESTORE, test x"$NO_RESTORE_MODE" != x"true")
2909 AM_CONDITIONAL(WANT_SERVER, test x"$NO_SERVER_MODE" != x"true")
2910 AM_CONDITIONAL(WANT_RECOVER, test x"$NO_RECOVER_MODE" != x"true" && test x"$NO_CLIENT_MODE" != x"true")
2911 AM_CONDITIONAL(WANT_TAPE, test x"$NO_SERVER_MODE" != x"true" || test x"$NO_RESTORE_MODE" != x"true")
2912 AM_CONDITIONAL(WANT_AMPLOT, test x"$NO_AMPLOT_MODE" != x"true")
2913 AM_CONDITIONAL(WANT_CHG_SCSI, test x"$NO_SCSI_CHANGER_MODE" != x"true")
2914 AM_CONDITIONAL(WANT_CHIO_SCSI, test x"$NO_CHIO_CHANGER_MODE" != x"true")
2915 AM_CONDITIONAL(WANT_RUNTIME_PSEUDO_RELOC, test x"$NEED_RUNTIME_PSEUDO_RELOC" = x"true")
2916 AM_CONDITIONAL(WANT_SETUID_CLIENT, test x"$NEED_SETUID_CLIENT" != x"false")
2917 AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY_SET" = x"true")
2919 case "${FORCE_USE_RUNDUMP-${USE_RUNDUMP}}" in
2920 y | ye | yes) AC_DEFINE(USE_RUNDUMP,1,[Define to invoke rundump (setuid-root) instead of DUMP program directly. ]);;
2923 # This is necessary so that .o files in LIBOBJS are also built via
2924 # the ANSI2KNR-filtering rules.
2925 LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
2926 sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
2927 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
2928 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
2931 LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'`
2934 ## This stuff is needed for the documentation.
2935 DOC_BUILD_DATE=`date '+%d-%m-%Y'`
2936 AC_SUBST(DOC_BUILD_DATE)
2938 AC_ARG_WITH(xsltproc,
2939 [ --without-built-manpages Do not build manpages from XML source.],
2940 [ case "$withval" in
2947 XSLTPROC="$withval";;
2950 [ USE_XSLTPROC=maybe; ])
2952 AC_DEFUN([AC_PATH_XSLTPROC], [AC_PATH_PROG(XSLTPROC, xsltproc)])
2954 # This looks bad, but && and || have equal precedence in shells, so
2955 # actually it's all OK.
2956 if test "$USE_XSLTPROC" = "yes" || test "$USE_XSLTPROC" = "maybe" && \
2957 test -z "$XSLTPROC"; then
2959 if test -n "$XSLTPROC"; then
2962 if test "$USE_XSLTPROC" = yes; then
2963 AC_MSG_ERROR([can't find xsltproc, but running with --with-xsltproc.])
2970 AM_CONDITIONAL(HAVE_XSLTPROC, test "$USE_XSLTPROC" = yes)
2973 amplot/amcat.awk amplot/amplot.sh \
2976 changer-src/chg-manual.sh changer-src/chg-multi.sh \
2977 changer-src/chg-mtx.sh changer-src/chg-chs.sh \
2978 changer-src/chg-rth.pl changer-src/chg-chio.pl \
2979 changer-src/chg-zd-mtx.sh changer-src/Makefile \
2980 changer-src/chg-juke.sh changer-src/chg-rait.sh \
2981 changer-src/chg-null.sh changer-src/chg-mcutil.sh \
2982 changer-src/chg-disk.sh changer-src/chg-iomega.pl \
2984 client-src/patch-system.sh client-src/Makefile \
2986 dumper-src/gnutar.pl dumper-src/generic-dumper.pl \
2987 dumper-src/Makefile \
2989 common-src/versuff.c common-src/Makefile \
2991 example/amanda.conf example/Makefile \
2992 example/chg-mcutil.conf \
2998 recover-src/Makefile \
3000 restore-src/Makefile \
3002 server-src/amcheckdb.sh server-src/amcleanup.sh \
3003 server-src/amdump.sh server-src/amfreetapes.sh \
3004 server-src/amoverview.pl server-src/amrmtape.sh \
3005 server-src/amtoc.pl server-src/amverify.sh \
3006 server-src/Makefile server-src/amstatus.pl \
3007 server-src/amverifyrun.sh server-src/amcrypt.sh \
3008 server-src/amaespipe.sh \
3012 config/Makefile Makefile])