source: trunk/mondo/configure.in @ 115

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

x86_64 support (begining)
find_and_store_mondoarchives_home interface change
libmondo-tools.c modified with asprintf

  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1dnl Autoconfigure file for Mondo Rescue v2.0x_berlios
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 94 2005-10-28 23:08:39Z andree $
8dnl
9AC_INIT([Mondo Rescue],[2.05_berlios],[mondo-devel@lists.sourceforge.net])
10AC_CONFIG_SRCDIR([mondo/mondoarchive/main.c])
11AM_CONFIG_HEADER(config.h)
12
13AC_CANONICAL_HOST
14AC_CANONICAL_TARGET
15AC_ARG_PROGRAM
16
17AM_INIT_AUTOMAKE([mondo], [2.05_berlios])
18AM_MAINTAINER_MODE
19
20AM_PROG_LIBTOOL
21AC_PROG_CXX
22AC_PROG_AWK
23AC_PROG_CC
24AC_PROG_CPP
25AC_PROG_INSTALL
26AC_PROG_LN_S
27AC_PROG_MAKE_SET
28
29
30dnl --with/--enable stuff
31do_static_mr=
32AC_ARG_WITH(x11, AS_HELP_STRING(--with-x11,Create libXmondo and XMondo for X11/KDE support), do_x=$withval, do_x= )
33AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
34AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
35AC_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)
36AC_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)
37if test x$do_static_mr = xyes; then
38    MONDORESTORE_STATIC=-static
39else
40    MONDORESTORE_STATIC=
41fi
42AC_SUBST(MONDORESTORE_STATIC)
43AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
44AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
45if test -n "$do_x"; then
46    AC_DEFINE(WITH_X, 1, [Define if compiled with X support])
47else
48    AC_DEFINE(WITH_X, 0, [Define if compiled with X support])
49fi
50AM_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.
55AC_CHECK_LIB([dl], [main])
56AC_CHECK_LIB([newt], [newtInit])
57standardthread=0;
58
59case $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        ;;
82esac
83
84if test "$host_cpu" != "$target_cpu"; then
85    host_cpu=$target_cpu
86fi
87case "$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        ;;
104esac
105AC_SUBST(ARCH)
106
107LIBS="$LIBS $PTHREAD"
108AC_SUBST(LIBS)
109
110if 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)
116else
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=
124fi
125AC_SUBST(XMONDO)
126AC_SUBST(QT_LIBRARY)
127
128# Checks for header files.
129AC_HEADER_STDC
130AC_HEADER_SYS_WAIT
131AC_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.
134AC_C_CONST
135AC_TYPE_OFF_T
136AC_TYPE_PID_T
137
138# Checks for library functions.
139AC_FUNC_CHOWN
140AC_FUNC_FORK
141AC_PROG_GCC_TRADITIONAL
142AC_FUNC_LSTAT
143AC_FUNC_MALLOC
144AC_TYPE_SIGNAL
145AC_FUNC_VPRINTF
146AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr getline asprintf trunc vasprintf])
147
148if test -n "$qt_includes"; then
149    my_qt_includes="-I$qt_includes"
150else
151    my_qt_includes=""
152fi
153AC_SUBST(my_qt_includes)
154
155if test -n "$qt_libraries"; then
156    my_qt_libraries="-L$qt_libraries"
157else
158    my_qt_libraries=""
159fi
160AC_SUBST(my_qt_libraries)
161
162if test -n "$kde_includes"; then
163    my_kde_includes="-I$kde_includes"
164else
165    my_kde_includes=""
166fi
167AC_SUBST(my_kde_includes)
168
169if test -n "$kde_libraries"; then
170    my_kde_libraries="-L$kde_libraries"
171else
172    my_kde_libraries=""
173fi
174AC_SUBST(my_kde_libraries)
175
176AC_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])
Note: See TracBrowser for help on using the repository browser.