[179] | 1 | dnl Autoconfigure file for Mondo Rescue v2.0x
|
---|
[553] | 2 | dnl Mondo by Mondo dev team
|
---|
[1] | 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
|
---|
[102] | 7 | dnl $Id: configure.in 1189 2007-02-20 09:44:11Z bruno $
|
---|
[1] | 8 | dnl
|
---|
[237] | 9 | define(MONDO_VER,m4_normalize(esyscmd(cat VERSION)))
|
---|
| 10 | define(MONDO_REV,m4_normalize(esyscmd(cat REVISION | awk '{print r$1}')))
|
---|
[215] | 11 | define(MONDO_TAG,MONDO_VER-MONDO_REV)
|
---|
| 12 | AC_INIT([Mondo Rescue],MONDO_TAG,[mondo-devel@lists.sourceforge.net])
|
---|
[1189] | 13 | AC_CONFIG_SRCDIR([src/mondoarchive/mondoarchive.c])
|
---|
[1] | 14 | AM_CONFIG_HEADER(config.h)
|
---|
| 15 |
|
---|
| 16 | AC_CANONICAL_HOST
|
---|
| 17 | AC_CANONICAL_TARGET
|
---|
| 18 | AC_ARG_PROGRAM
|
---|
| 19 |
|
---|
[919] | 20 | AM_INIT_AUTOMAKE([mondo], MONDO_VER)
|
---|
[1] | 21 | AM_MAINTAINER_MODE
|
---|
| 22 |
|
---|
| 23 | AC_PROG_CXX
|
---|
| 24 | AC_PROG_AWK
|
---|
| 25 | AC_PROG_CC
|
---|
[423] | 26 | AC_PROG_RANLIB
|
---|
[1] | 27 | AC_PROG_CPP
|
---|
| 28 | AC_PROG_INSTALL
|
---|
| 29 | AC_PROG_LN_S
|
---|
| 30 | AC_PROG_MAKE_SET
|
---|
| 31 |
|
---|
[1051] | 32 | AM_GNU_GETTEXT([external])
|
---|
| 33 | ALL_LINGUAS="fr"
|
---|
[1] | 34 |
|
---|
| 35 | dnl --with/--enable stuff
|
---|
| 36 | do_static_mr=
|
---|
| 37 | AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
|
---|
| 38 | AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
|
---|
| 39 | 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)
|
---|
| 40 | 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)
|
---|
| 41 | if test x$do_static_mr = xyes; then
|
---|
| 42 | MONDORESTORE_STATIC=-static
|
---|
| 43 | else
|
---|
| 44 | MONDORESTORE_STATIC=
|
---|
| 45 | fi
|
---|
| 46 | AC_SUBST(MONDORESTORE_STATIC)
|
---|
| 47 | AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
|
---|
| 48 | AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
|
---|
| 49 |
|
---|
| 50 | # ( 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]) ) )
|
---|
| 51 |
|
---|
| 52 | # Checks for libraries.
|
---|
[423] | 53 | dnl AC_CHECK_LIB([dl], [main])
|
---|
[1] | 54 | AC_CHECK_LIB([newt], [newtInit])
|
---|
| 55 | standardthread=0;
|
---|
| 56 |
|
---|
| 57 | case $build in
|
---|
| 58 | *freebsd*)
|
---|
| 59 | standardthread=0
|
---|
| 60 | 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)
|
---|
| 61 | if test $standardthread -eq 0; then
|
---|
[182] | 62 | CPPFLAGS=$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads
|
---|
[1] | 63 | PTHREAD="-L/usr/local/lib -llthread -llgcc_r";
|
---|
| 64 | if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then
|
---|
| 65 | echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?"
|
---|
| 66 | exit 1
|
---|
| 67 | fi
|
---|
| 68 | 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])
|
---|
| 69 | else
|
---|
| 70 | PTHREAD="-lc_r"
|
---|
| 71 | fi
|
---|
| 72 | ;;
|
---|
| 73 | *linux*)
|
---|
| 74 | 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])
|
---|
| 75 | PTHREAD="-lpthread"
|
---|
[1115] | 76 | CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -Wshadow -funsigned-char -Wstrict-prototypes -Wunused -Winit-self -Wcast-align -fno-strict-aliasing"
|
---|
[1] | 77 | ;;
|
---|
| 78 | *)
|
---|
| 79 | echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?"
|
---|
| 80 | ;;
|
---|
| 81 | esac
|
---|
| 82 |
|
---|
| 83 | if test "$host_cpu" != "$target_cpu"; then
|
---|
| 84 | host_cpu=$target_cpu
|
---|
| 85 | fi
|
---|
| 86 | case "$host_cpu" in
|
---|
| 87 | i?86*)
|
---|
| 88 | ARCH=i386
|
---|
[1051] | 89 | CPPFLAGS="$CPPFLAGS -D__IA32__ -Wall"
|
---|
[1] | 90 | ;;
|
---|
[1051] | 91 | x86_64*)
|
---|
| 92 | ARCH=x86-64
|
---|
| 93 | CPPFLAGS="$CPPFLAGS -D__X86_64__ -Wall"
|
---|
| 94 | ;;
|
---|
[1] | 95 | ia64*)
|
---|
| 96 | ARCH=ia64
|
---|
[1051] | 97 | CPPFLAGS="$CPPFLAGS -D__IA64__ -Wall"
|
---|
[1] | 98 | ;;
|
---|
| 99 | *)
|
---|
[1051] | 100 | echo "*** Sorry, only Intel Architectures (ia32, x86-64, ia64) are supported at this time."
|
---|
| 101 | echo "If you Want to help send a mail to bcornec@users.berlios.de"
|
---|
[1] | 102 | ;;
|
---|
| 103 | esac
|
---|
| 104 | AC_SUBST(ARCH)
|
---|
| 105 |
|
---|
| 106 | LIBS="$LIBS $PTHREAD"
|
---|
| 107 | AC_SUBST(LIBS)
|
---|
| 108 |
|
---|
| 109 | # Checks for header files.
|
---|
| 110 | AC_HEADER_STDC
|
---|
| 111 | AC_HEADER_SYS_WAIT
|
---|
| 112 | AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h])
|
---|
| 113 |
|
---|
| 114 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
| 115 | AC_C_CONST
|
---|
| 116 | AC_TYPE_OFF_T
|
---|
| 117 | AC_TYPE_PID_T
|
---|
| 118 |
|
---|
| 119 | # Checks for library functions.
|
---|
| 120 | AC_FUNC_CHOWN
|
---|
| 121 | AC_FUNC_FORK
|
---|
| 122 | AC_PROG_GCC_TRADITIONAL
|
---|
| 123 | AC_FUNC_LSTAT
|
---|
| 124 | AC_FUNC_MALLOC
|
---|
| 125 | AC_TYPE_SIGNAL
|
---|
| 126 | AC_FUNC_VPRINTF
|
---|
[1051] | 127 | AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr strspn getline asprintf trunc vasprintf])
|
---|
[1] | 128 |
|
---|
[1051] | 129 | AC_OUTPUT([Makefile src/Makefile src/common/Makefile src/lib/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/restore-scripts/usr/Makefile src/restore-scripts/usr/bin/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile])
|
---|