[181] | 1 | dnl Autoconfigure file for Mondo Rescue v2.0x
|
---|
[1] | 2 | dnl Mondo by Hugo Rabson
|
---|
| 3 | dnl This script by Joshua Oreman
|
---|
| 4 | dnl
|
---|
| 5 | dnl Process this file with autoconf >=2.53 to produce a configure script.
|
---|
| 6 | dnl
|
---|
[41] | 7 | dnl $Id: configure.in 183 2005-12-13 01:20:45Z bcornec $
|
---|
[1] | 8 | dnl
|
---|
[41] | 9 | AC_INIT([Mondo Rescue],[2.05_berlios],[mondo-devel@lists.sourceforge.net])
|
---|
[1] | 10 | AC_CONFIG_SRCDIR([mondo/mondoarchive/main.c])
|
---|
| 11 | AM_CONFIG_HEADER(config.h)
|
---|
| 12 |
|
---|
| 13 | AC_CANONICAL_HOST
|
---|
| 14 | AC_CANONICAL_TARGET
|
---|
| 15 | AC_ARG_PROGRAM
|
---|
| 16 |
|
---|
[41] | 17 | AM_INIT_AUTOMAKE([mondo], [2.05_berlios])
|
---|
[1] | 18 | AM_MAINTAINER_MODE
|
---|
| 19 |
|
---|
| 20 | AM_PROG_LIBTOOL
|
---|
| 21 | AC_PROG_CXX
|
---|
| 22 | AC_PROG_AWK
|
---|
| 23 | AC_PROG_CC
|
---|
| 24 | AC_PROG_CPP
|
---|
| 25 | AC_PROG_INSTALL
|
---|
| 26 | AC_PROG_LN_S
|
---|
| 27 | AC_PROG_MAKE_SET
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | dnl --with/--enable stuff
|
---|
| 31 | do_static_mr=
|
---|
| 32 | AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
|
---|
| 33 | AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
|
---|
| 34 | AC_ARG_WITH(max-noof-media, AS_HELP_STRING(--with-max-noof-media=NUM,Compile for a certain maximum number of media (default 50)), max_noof_media=$withval, max_noof_media=50)
|
---|
| 35 | AC_ARG_WITH(tape-block-size, AS_HELP_STRING(--with-tape-block-size=NUM,Set tape block size in kilobytes (default 131072)), exttape=${withval:=131072}, exttape=131072)
|
---|
| 36 | if test x$do_static_mr = xyes; then
|
---|
| 37 | MONDORESTORE_STATIC=-static
|
---|
| 38 | else
|
---|
| 39 | MONDORESTORE_STATIC=
|
---|
| 40 | fi
|
---|
| 41 | AC_SUBST(MONDORESTORE_STATIC)
|
---|
| 42 | AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
|
---|
| 43 | AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
|
---|
| 44 |
|
---|
| 45 | # ( which automake 2>/dev/null >/dev/null && ( automake --version 2>&1 | grep -q 1.5 || automake --version 2>&1 | grep -q 1.7 || AC_MSG_ERROR([Automake must be version 1.5 or 1.7, if you have it at all]) ) )
|
---|
| 46 |
|
---|
| 47 | # Checks for libraries.
|
---|
| 48 | AC_CHECK_LIB([dl], [main])
|
---|
| 49 | AC_CHECK_LIB([newt], [newtInit])
|
---|
| 50 | standardthread=0;
|
---|
| 51 |
|
---|
| 52 | case $build in
|
---|
| 53 | *freebsd*)
|
---|
| 54 | standardthread=0
|
---|
| 55 | AC_ARG_ENABLE(standard-pthreads, AS_HELP_STRING(--enable-standard-pthreads,(FreeBSD only) Compile with FreeBSD "standard" pthreads instead of LinuxThreads -- *MAY BE UNSTABLE*), standardthread=1, standardthread=0)
|
---|
| 56 | if test $standardthread -eq 0; then
|
---|
[183] | 57 | CPPFLAGS=$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads
|
---|
[1] | 58 | PTHREAD="-L/usr/local/lib -llthread -llgcc_r";
|
---|
| 59 | if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then
|
---|
| 60 | echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?"
|
---|
| 61 | exit 1
|
---|
| 62 | fi
|
---|
| 63 | AC_CHECK_LIB(lthread, pthread_create, true, [echo "*** Cannot find -llthread."; echo "*** Please install linuxthreads from /usr/ports/devel/linuxthreads."; exit 1], [-L/usr/local/lib -llgcc_r])
|
---|
| 64 | else
|
---|
| 65 | PTHREAD="-lc_r"
|
---|
| 66 | fi
|
---|
| 67 | ;;
|
---|
| 68 | *linux*)
|
---|
| 69 | AC_CHECK_LIB(pthread, pthread_create, true, [echo "*** Cannot find -lpthread."; echo "*** Please make sure you have the linuxthreads glibc add-on installed."; exit 1])
|
---|
| 70 | PTHREAD="-lpthread"
|
---|
| 71 | ;;
|
---|
| 72 | *)
|
---|
| 73 | echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?"
|
---|
| 74 | ;;
|
---|
| 75 | esac
|
---|
| 76 |
|
---|
| 77 | if test "$host_cpu" != "$target_cpu"; then
|
---|
| 78 | host_cpu=$target_cpu
|
---|
| 79 | fi
|
---|
| 80 | case "$host_cpu" in
|
---|
| 81 | i?86*)
|
---|
| 82 | ARCH=i386
|
---|
[87] | 83 | CPPFLAGS="$CPPFLAGS -D__IA32__ -Wall"
|
---|
[1] | 84 | ;;
|
---|
[94] | 85 | x86_64*)
|
---|
| 86 | ARCH=x86-64
|
---|
| 87 | CPPFLAGS="$CPPFLAGS -D__X86_64__ -Wall"
|
---|
| 88 | ;;
|
---|
[1] | 89 | ia64*)
|
---|
| 90 | ARCH=ia64
|
---|
[87] | 91 | CPPFLAGS="$CPPFLAGS -D__IA64__ -Wall"
|
---|
[1] | 92 | ;;
|
---|
| 93 | *)
|
---|
[94] | 94 | echo "*** Sorry, only Intel Architectures (ia32, x86-64, ia64) are supported at this time."
|
---|
| 95 | echo "If you Want to help send a mail to bcornec@users.berlios.de"
|
---|
[1] | 96 | ;;
|
---|
| 97 | esac
|
---|
| 98 | AC_SUBST(ARCH)
|
---|
| 99 |
|
---|
| 100 | LIBS="$LIBS $PTHREAD"
|
---|
| 101 | AC_SUBST(LIBS)
|
---|
| 102 |
|
---|
[129] | 103 | dnl AC_FIND_BZIP2
|
---|
[1] | 104 |
|
---|
| 105 | # Checks for header files.
|
---|
| 106 | AC_HEADER_STDC
|
---|
| 107 | AC_HEADER_SYS_WAIT
|
---|
| 108 | AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h])
|
---|
| 109 |
|
---|
| 110 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
| 111 | AC_C_CONST
|
---|
| 112 | AC_TYPE_OFF_T
|
---|
| 113 | AC_TYPE_PID_T
|
---|
| 114 |
|
---|
| 115 | # Checks for library functions.
|
---|
| 116 | AC_FUNC_CHOWN
|
---|
| 117 | AC_FUNC_FORK
|
---|
| 118 | AC_PROG_GCC_TRADITIONAL
|
---|
| 119 | AC_FUNC_LSTAT
|
---|
| 120 | AC_FUNC_MALLOC
|
---|
| 121 | AC_TYPE_SIGNAL
|
---|
| 122 | AC_FUNC_VPRINTF
|
---|
[87] | 123 | AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr getline asprintf trunc vasprintf])
|
---|
[1] | 124 |
|
---|
[129] | 125 | AC_OUTPUT([Makefile mondo/Makefile mondo/common/Makefile mondo/mondoarchive/Makefile mondo/mondorestore/Makefile mondo/docs/Makefile mondo/docs/en/Makefile mondo/docs/en/1.6x-howto/Makefile mondo/restore-scripts/Makefile mondo/restore-scripts/mondo/Makefile mondo/restore-scripts/usr/Makefile mondo/restore-scripts/usr/bin/Makefile])
|
---|