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