source: MondoRescue/branches/3.0/mondo/configure.in@ 3030

Last change on this file since 3030 was 3030, checked in by Bruno Cornec, 12 years ago

r4952@localhost: bruno | 2012-09-02 18:32:23 +0200

  • Improve configure.in for mondo based on autoscan results
  • Property svn:keywords set to Id Rev
File size: 4.8 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 3030 2012-09-04 01:09:47Z 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_PREREQ
18AC_CANONICAL_HOST
19AC_CANONICAL_TARGET
20AC_ARG_PROGRAM
21
22AM_INIT_AUTOMAKE([mondo], MONDO_VER)
23AM_MAINTAINER_MODE
24
25LT_INIT
26
27AC_PROG_CXX
28AC_PROG_AWK
29AC_PROG_CC
30#AC_PROG_RANLIB
31AC_PROG_LIBTOOL
32AC_PROG_CPP
33AC_PROG_INSTALL
34AC_PROG_LN_S
35AC_PROG_MAKE_SET
36
37
38dnl --with/--enable stuff
39do_static_mr=
40AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
41AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
42AC_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)
43AC_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)
44if test x$do_static_mr = xyes; then
45 MONDORESTORE_STATIC=-static
46else
47 MONDORESTORE_STATIC=
48fi
49AC_SUBST(MONDORESTORE_STATIC)
50AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
51AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
52
53# ( 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]) ) )
54
55# Checks for libraries.
56dnl AC_CHECK_LIB([dl], [main])
57AC_CHECK_LIB([newt], [newtInit])
58standardthread=0;
59
60case $build in
61 *freebsd*)
62 standardthread=0
63 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)
64 if test $standardthread -eq 0; then
65 CPPFLAGS=$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads
66 PTHREAD="-L/usr/local/lib -llthread -llgcc_r";
67 if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then
68 echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?"
69 exit 1
70 fi
71 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])
72 else
73 PTHREAD="-lc_r"
74 fi
75 ;;
76 *linux*)
77 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])
78 PTHREAD="-lpthread"
79 GCC_MAJ="`gcc -dumpversion 2>&1 | cut -d. -f1`"
80 GCC_MIN="`gcc -dumpversion 2>&1 | cut -d. -f2`"
81 CFLAGS="$CFLAGS -Wall -Wno-return-type -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT"
82 if test "$GCC_MAJ" -ge "4" && test "$GCC_MIN" -ge "2"; then
83 CFLAGS="$CFLAGS -Werror=format-security"
84 fi
85 ;;
86 *)
87 echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?"
88 ;;
89esac
90
91if test "$host_cpu" != "$target_cpu"; then
92 host_cpu=$target_cpu
93fi
94case "$host_cpu" in
95 i?86*)
96 CPPFLAGS="$CPPFLAGS -D__IA32__"
97 ;;
98 x86_64*)
99 CPPFLAGS="$CPPFLAGS -D__IA32__ -D__X86_64__"
100 ;;
101 ia64*)
102 CPPFLAGS="$CPPFLAGS -D__IA64__"
103 ;;
104 *)
105 echo "*** Sorry, only Intel Architectures (ia32, x86_64, ia64) are supported at this time. Want to help?"
106 ;;
107esac
108
109LIBS="$LIBS $PTHREAD"
110AC_SUBST(LIBS)
111
112# Checks for header files.
113AC_HEADER_STDC
114AC_HEADER_SYS_WAIT
115AC_HEADER_STDBOOL
116AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h utime.h])
117
118# Checks for typedefs, structures, and compiler characteristics.
119AC_C_CONST
120AC_C_INLINE
121AC_PROG_GCC_TRADITIONAL
122AC_TYPE_MODE_T
123AC_TYPE_OFF_T
124AC_TYPE_PID_T
125AC_TYPE_SIGNAL
126AC_TYPE_SIZE_T
127AC_TYPE_SSIZE_T
128
129# Checks for library functions.
130AC_FUNC_CHOWN
131AC_FUNC_FORK
132AC_FUNC_FSEEKO
133AC_FUNC_LSTAT
134AC_FUNC_MALLOC
135AC_FUNC_VPRINTF
136AC_CHECK_FUNCS([bzero getcwd gethostbyname inet_ntoa memmove memset mkdir mkdtemp mkfifo setenv strcasecmp strcspn strchr strdup strerror strncasecmp strrchr strspn strstr uname utime])
137
138AC_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.