[179] | 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
|
---|
[102] | 7 | dnl $Id: configure.in 247 2005-12-20 12:24:03Z bcornec $
|
---|
[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])
|
---|
[1] | 13 | AC_CONFIG_SRCDIR([mondo/mondoarchive/main.c])
|
---|
| 14 | AM_CONFIG_HEADER(config.h)
|
---|
| 15 |
|
---|
| 16 | AC_CANONICAL_HOST
|
---|
| 17 | AC_CANONICAL_TARGET
|
---|
| 18 | AC_ARG_PROGRAM
|
---|
| 19 |
|
---|
[218] | 20 | AM_INIT_AUTOMAKE([mondo], MONDO_VER)
|
---|
[1] | 21 | AM_MAINTAINER_MODE
|
---|
| 22 |
|
---|
| 23 | AM_PROG_LIBTOOL
|
---|
| 24 | AC_PROG_CXX
|
---|
| 25 | AC_PROG_AWK
|
---|
| 26 | AC_PROG_CC
|
---|
| 27 | AC_PROG_CPP
|
---|
| 28 | AC_PROG_INSTALL
|
---|
| 29 | AC_PROG_LN_S
|
---|
| 30 | AC_PROG_MAKE_SET
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | dnl --with/--enable stuff
|
---|
| 34 | do_static_mr=
|
---|
[182] | 35 | AC_ARG_ENABLE(x11, AS_HELP_STRING(--enable-x11,Create libXmondo and XMondo for X11/KDE support), do_x=$withval, do_x= )
|
---|
[1] | 36 | AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
|
---|
| 37 | AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
|
---|
| 38 | 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)
|
---|
| 39 | 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)
|
---|
| 40 | if test x$do_static_mr = xyes; then
|
---|
| 41 | MONDORESTORE_STATIC=-static
|
---|
| 42 | else
|
---|
| 43 | MONDORESTORE_STATIC=
|
---|
| 44 | fi
|
---|
| 45 | AC_SUBST(MONDORESTORE_STATIC)
|
---|
| 46 | AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
|
---|
| 47 | AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
|
---|
[182] | 48 | if test x$do_x = xyes; then
|
---|
[1] | 49 | AC_DEFINE(WITH_X, 1, [Define if compiled with X support])
|
---|
| 50 | else
|
---|
| 51 | AC_DEFINE(WITH_X, 0, [Define if compiled with X support])
|
---|
| 52 | fi
|
---|
| 53 | AM_CONDITIONAL(XWIN, test x$do_x = xyes)
|
---|
| 54 |
|
---|
| 55 | # ( 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]) ) )
|
---|
| 56 |
|
---|
| 57 | # Checks for libraries.
|
---|
| 58 | AC_CHECK_LIB([dl], [main])
|
---|
| 59 | AC_CHECK_LIB([newt], [newtInit])
|
---|
| 60 | standardthread=0;
|
---|
| 61 |
|
---|
| 62 | case $build in
|
---|
| 63 | *freebsd*)
|
---|
| 64 | standardthread=0
|
---|
| 65 | 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)
|
---|
| 66 | if test $standardthread -eq 0; then
|
---|
[182] | 67 | CPPFLAGS=$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads
|
---|
[1] | 68 | PTHREAD="-L/usr/local/lib -llthread -llgcc_r";
|
---|
| 69 | if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then
|
---|
| 70 | echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?"
|
---|
| 71 | exit 1
|
---|
| 72 | fi
|
---|
| 73 | 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])
|
---|
| 74 | else
|
---|
| 75 | PTHREAD="-lc_r"
|
---|
| 76 | fi
|
---|
| 77 | ;;
|
---|
| 78 | *linux*)
|
---|
| 79 | 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])
|
---|
| 80 | PTHREAD="-lpthread"
|
---|
| 81 | ;;
|
---|
| 82 | *)
|
---|
| 83 | echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?"
|
---|
| 84 | ;;
|
---|
| 85 | esac
|
---|
| 86 |
|
---|
| 87 | if test "$host_cpu" != "$target_cpu"; then
|
---|
| 88 | host_cpu=$target_cpu
|
---|
| 89 | fi
|
---|
| 90 | case "$host_cpu" in
|
---|
| 91 | i?86*)
|
---|
| 92 | #x86_64*)
|
---|
| 93 | ARCH=i386
|
---|
| 94 | CPPFLAGS="$CPPFLAGS -D__IA32__"
|
---|
| 95 | ;;
|
---|
| 96 | ia64*)
|
---|
| 97 | ARCH=ia64
|
---|
| 98 | CPPFLAGS="$CPPFLAGS -D__IA64__"
|
---|
| 99 | ;;
|
---|
| 100 | *)
|
---|
| 101 | echo "*** Sorry, only Intel Architectures (ia32, ia64) are supported at this time. Want to help?"
|
---|
| 102 | ;;
|
---|
| 103 | esac
|
---|
| 104 | AC_SUBST(ARCH)
|
---|
| 105 |
|
---|
| 106 | LIBS="$LIBS $PTHREAD"
|
---|
| 107 | AC_SUBST(LIBS)
|
---|
| 108 |
|
---|
| 109 | if test x$do_x = xyes ; then
|
---|
| 110 | XMONDO=xmondo
|
---|
| 111 | QT_LIBRARY=-lqt
|
---|
| 112 | AC_PATH_XTRA
|
---|
[17] | 113 | dnl AC_PATH_KDE
|
---|
| 114 | dnl KDE_USE_QT(3)
|
---|
[1] | 115 | else
|
---|
| 116 | dnl Automake requires all conditionals to be done sometime; if they're not being
|
---|
| 117 | dnl done by the KDE checks, they're done here.
|
---|
| 118 | AM_CONDITIONAL(include_ARTS, false)
|
---|
[17] | 119 | dnl AC_FIND_BZIP2
|
---|
| 120 | dnl KDE_CHECK_BINUTILS
|
---|
[1] | 121 | XMONDO=
|
---|
| 122 | QT_LIBRARY=
|
---|
| 123 | fi
|
---|
| 124 | AC_SUBST(XMONDO)
|
---|
| 125 | AC_SUBST(QT_LIBRARY)
|
---|
| 126 |
|
---|
| 127 | # Checks for header files.
|
---|
| 128 | AC_HEADER_STDC
|
---|
| 129 | AC_HEADER_SYS_WAIT
|
---|
| 130 | AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h])
|
---|
| 131 |
|
---|
| 132 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
| 133 | AC_C_CONST
|
---|
| 134 | AC_TYPE_OFF_T
|
---|
| 135 | AC_TYPE_PID_T
|
---|
| 136 |
|
---|
| 137 | # Checks for library functions.
|
---|
| 138 | AC_FUNC_CHOWN
|
---|
| 139 | AC_FUNC_FORK
|
---|
| 140 | AC_PROG_GCC_TRADITIONAL
|
---|
| 141 | AC_FUNC_LSTAT
|
---|
| 142 | AC_FUNC_MALLOC
|
---|
| 143 | AC_TYPE_SIGNAL
|
---|
| 144 | AC_FUNC_VPRINTF
|
---|
| 145 | AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr])
|
---|
| 146 |
|
---|
| 147 | if test -n "$qt_includes"; then
|
---|
| 148 | my_qt_includes="-I$qt_includes"
|
---|
| 149 | else
|
---|
| 150 | my_qt_includes=""
|
---|
| 151 | fi
|
---|
| 152 | AC_SUBST(my_qt_includes)
|
---|
| 153 |
|
---|
| 154 | if test -n "$qt_libraries"; then
|
---|
| 155 | my_qt_libraries="-L$qt_libraries"
|
---|
| 156 | else
|
---|
| 157 | my_qt_libraries=""
|
---|
| 158 | fi
|
---|
| 159 | AC_SUBST(my_qt_libraries)
|
---|
| 160 |
|
---|
| 161 | if test -n "$kde_includes"; then
|
---|
| 162 | my_kde_includes="-I$kde_includes"
|
---|
| 163 | else
|
---|
| 164 | my_kde_includes=""
|
---|
| 165 | fi
|
---|
| 166 | AC_SUBST(my_kde_includes)
|
---|
| 167 |
|
---|
| 168 | if test -n "$kde_libraries"; then
|
---|
| 169 | my_kde_libraries="-L$kde_libraries"
|
---|
| 170 | else
|
---|
| 171 | my_kde_libraries=""
|
---|
| 172 | fi
|
---|
| 173 | AC_SUBST(my_kde_libraries)
|
---|
| 174 |
|
---|
[247] | 175 | 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 mondo/xmondo/Makefile mondo/post-nuke.sample/Makefile mondo/post-nuke.sample/usr/Makefile mondo/post-nuke.sample/usr/bin/Makefile])
|
---|