dnl Autoconfigure file for Mondo Rescue v2.0x dnl Mondo by Hugo Rabson dnl This script by Joshua Oreman dnl dnl Process this file with autoconf >=2.53 to produce a configure script. dnl dnl $Id: configure.in 179 2005-12-12 18:50:21Z bcornec $ dnl AC_INIT([Mondo Rescue],[2.05],[mondo-devel@lists.sourceforge.net]) AC_CONFIG_SRCDIR([mondo/mondoarchive/main.c]) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_ARG_PROGRAM AM_INIT_AUTOMAKE([mondo], [2.05]) AM_MAINTAINER_MODE AM_PROG_LIBTOOL AC_PROG_CXX AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl --with/--enable stuff do_static_mr= AC_ARG_WITH(x11, AS_HELP_STRING(--with-x11,Create libXmondo and XMondo for X11/KDE support), do_x=$withval, do_x= ) AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= ) AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", ) 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) 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) if test x$do_static_mr = xyes; then MONDORESTORE_STATIC=-static else MONDORESTORE_STATIC= fi AC_SUBST(MONDORESTORE_STATIC) AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media]) AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize]) if test -n "$do_x"; then AC_DEFINE(WITH_X, 1, [Define if compiled with X support]) else AC_DEFINE(WITH_X, 0, [Define if compiled with X support]) fi AM_CONDITIONAL(XWIN, test x$do_x = xyes) # ( 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]) ) ) # Checks for libraries. AC_CHECK_LIB([dl], [main]) AC_CHECK_LIB([newt], [newtInit]) standardthread=0; case $build in *freebsd*) standardthread=0 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) if test $standardthread -eq 0; then CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads" PTHREAD="-L/usr/local/lib -llthread -llgcc_r"; if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?" exit 1 fi 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]) else PTHREAD="-lc_r" fi ;; *linux*) 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]) PTHREAD="-lpthread" ;; *) echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?" ;; esac if test "$host_cpu" != "$target_cpu"; then host_cpu=$target_cpu fi case "$host_cpu" in i?86*) #x86_64*) ARCH=i386 CPPFLAGS="$CPPFLAGS -D__IA32__" ;; ia64*) ARCH=ia64 CPPFLAGS="$CPPFLAGS -D__IA64__" ;; *) echo "*** Sorry, only Intel Architectures (ia32, ia64) are supported at this time. Want to help?" ;; esac AC_SUBST(ARCH) LIBS="$LIBS $PTHREAD" AC_SUBST(LIBS) if test x$do_x = xyes ; then XMONDO=xmondo QT_LIBRARY=-lqt AC_PATH_XTRA dnl AC_PATH_KDE dnl KDE_USE_QT(3) else dnl Automake requires all conditionals to be done sometime; if they're not being dnl done by the KDE checks, they're done here. AM_CONDITIONAL(include_ARTS, false) dnl AC_FIND_BZIP2 dnl KDE_CHECK_BINUTILS XMONDO= QT_LIBRARY= fi AC_SUBST(XMONDO) AC_SUBST(QT_LIBRARY) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T # Checks for library functions. AC_FUNC_CHOWN AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_LSTAT AC_FUNC_MALLOC AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr]) if test -n "$qt_includes"; then my_qt_includes="-I$qt_includes" else my_qt_includes="" fi AC_SUBST(my_qt_includes) if test -n "$qt_libraries"; then my_qt_libraries="-L$qt_libraries" else my_qt_libraries="" fi AC_SUBST(my_qt_libraries) if test -n "$kde_includes"; then my_kde_includes="-I$kde_includes" else my_kde_includes="" fi AC_SUBST(my_kde_includes) if test -n "$kde_libraries"; then my_kde_libraries="-L$kde_libraries" else my_kde_libraries="" fi AC_SUBST(my_kde_libraries) 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])