source: trunk/mondo/configure.in @ 250

Last change on this file since 250 was 250, checked in by bcornec, 14 years ago

merge -r243:249 $SVN_M/branches/2.05

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