source: MondoRescue/branches/2.2.9/mondo/configure.in@ 2239

Last change on this file since 2239 was 2239, checked in by Bruno Cornec, 15 years ago
  • Improves autotools usage and solve a build issue around config.guess files by copying them instead of linking them.
  • Property svn:keywords set to Id Rev
File size: 4.5 KB
Line 
1dnl Autoconfigure file for Mondo Rescue v2.0x
2dnl Mondo by Mondo dev team
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 2239 2009-06-23 11:13:13Z bruno $
8dnl
9define(MONDO_VER,m4_normalize(PBVER)))
10define(MONDO_REV,m4_normalize(rPBREV)))
11define(MONDO_TAG,MONDO_VER-MONDO_REV)
12AC_INIT([Mondo Rescue],MONDO_TAG,[mondo-devel@lists.sourceforge.net])
13AC_CONFIG_SRCDIR([src/mondoarchive/mondoarchive.c])
14AC_CONFIG_MACRO_DIR([m4])
15AM_CONFIG_HEADER(config.h)
16
17AC_CANONICAL_HOST
18AC_CANONICAL_TARGET
19AC_ARG_PROGRAM
20
21AM_INIT_AUTOMAKE([mondo], MONDO_VER)
22AM_MAINTAINER_MODE
23
24LT_INIT
25
26AC_PROG_CXX
27AC_PROG_AWK
28AC_PROG_CC
29#AC_PROG_RANLIB
30AC_PROG_CPP
31AC_PROG_INSTALL
32AC_PROG_LN_S
33AC_PROG_MAKE_SET
34
35
36dnl --with/--enable stuff
37do_static_mr=
38AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
39AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
40AC_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)
41AC_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)
42if test x$do_static_mr = xyes; then
43 MONDORESTORE_STATIC=-static
44else
45 MONDORESTORE_STATIC=
46fi
47AC_SUBST(MONDORESTORE_STATIC)
48AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
49AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
50
51# ( 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]) ) )
52
53# Checks for libraries.
54dnl AC_CHECK_LIB([dl], [main])
55AC_CHECK_LIB([newt], [newtInit])
56standardthread=0;
57
58case $build in
59 *freebsd*)
60 standardthread=0
61 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)
62 if test $standardthread -eq 0; then
63 CPPFLAGS=$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads
64 PTHREAD="-L/usr/local/lib -llthread -llgcc_r";
65 if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then
66 echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?"
67 exit 1
68 fi
69 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])
70 else
71 PTHREAD="-lc_r"
72 fi
73 ;;
74 *linux*)
75 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])
76 PTHREAD="-lpthread"
77 GCC_MAJ="`gcc -dumpversion 2>&1 | cut -d. -f1`"
78 GCC_MIN="`gcc -dumpversion 2>&1 | cut -d. -f2`"
79 CFLAGS="$CFLAGS -Wall -Wno-return-type -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT"
80 if test "$GCC_MAJ" -ge "4" && test "$GCC_MIN" -ge "2"; then
81 CFLAGS="$CFLAGS -Werror=format-security"
82 fi
83 ;;
84 *)
85 echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?"
86 ;;
87esac
88
89if test "$host_cpu" != "$target_cpu"; then
90 host_cpu=$target_cpu
91fi
92case "$host_cpu" in
93 i?86*)
94 CPPFLAGS="$CPPFLAGS -D__IA32__"
95 ;;
96 x86_64*)
97 CPPFLAGS="$CPPFLAGS -D__IA32__ -D__X86_64__"
98 ;;
99 ia64*)
100 CPPFLAGS="$CPPFLAGS -D__IA64__"
101 ;;
102 *)
103 echo "*** Sorry, only Intel Architectures (ia32, x86_64, ia64) are supported at this time. Want to help?"
104 ;;
105esac
106
107LIBS="$LIBS $PTHREAD"
108AC_SUBST(LIBS)
109
110# Checks for header files.
111AC_HEADER_STDC
112AC_HEADER_SYS_WAIT
113AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/time.h unistd.h])
114
115# Checks for typedefs, structures, and compiler characteristics.
116AC_C_CONST
117AC_TYPE_OFF_T
118AC_TYPE_PID_T
119
120# Checks for library functions.
121AC_FUNC_CHOWN
122AC_FUNC_FORK
123AC_PROG_GCC_TRADITIONAL
124AC_FUNC_LSTAT
125AC_FUNC_MALLOC
126AC_TYPE_SIGNAL
127AC_FUNC_VPRINTF
128AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr mkdtemp])
129
130AC_OUTPUT([Makefile src/Makefile src/lib/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile test/Makefile])
Note: See TracBrowser for help on using the repository browser.