[179] | 1 | dnl Autoconfigure file for Mondo Rescue v2.0x
|
---|
[553] | 2 | dnl Mondo by Mondo dev team
|
---|
[1] | 3 | dnl This script by Joshua Oreman
|
---|
| 4 | dnl
|
---|
| 5 | dnl Process this file with autoconf >=2.53 to produce a configure script.
|
---|
| 6 | dnl
|
---|
[102] | 7 | dnl $Id: configure.ac 3879 2024-03-09 02:10:04Z bruno $
|
---|
[1] | 8 | dnl
|
---|
[1618] | 9 | define(MONDO_VER,m4_normalize(PBVER)))
|
---|
[1636] | 10 | define(MONDO_REV,m4_normalize(rPBREV)))
|
---|
[215] | 11 | define(MONDO_TAG,MONDO_VER-MONDO_REV)
|
---|
[3414] | 12 | AC_INIT([mondo],[MONDO_TAG],[mondo-devel@lists.sourceforge.net])
|
---|
[3058] | 13 | AC_CONFIG_SRCDIR([src/mondoarchive/mondoarchive.c])
|
---|
[2239] | 14 | AC_CONFIG_MACRO_DIR([m4])
|
---|
[1] | 15 |
|
---|
[3879] | 16 | AC_PREREQ([2.71])
|
---|
[1] | 17 | AC_CANONICAL_HOST
|
---|
| 18 | AC_CANONICAL_TARGET
|
---|
| 19 | AC_ARG_PROGRAM
|
---|
| 20 |
|
---|
[3411] | 21 | AM_INIT_AUTOMAKE
|
---|
[2239] | 22 | LT_INIT
|
---|
| 23 |
|
---|
[1] | 24 | AC_PROG_CXX
|
---|
| 25 | AC_PROG_AWK
|
---|
| 26 | AC_PROG_CC
|
---|
[3411] | 27 | LT_INIT
|
---|
[1] | 28 | AC_PROG_CPP
|
---|
| 29 | AC_PROG_INSTALL
|
---|
| 30 | AC_PROG_LN_S
|
---|
| 31 | AC_PROG_MAKE_SET
|
---|
[3411] | 32 | AC_PROG_RANLIB
|
---|
[1] | 33 |
|
---|
| 34 | dnl --with/--enable stuff
|
---|
| 35 | do_static_mr=
|
---|
| 36 | AC_ARG_ENABLE(static-mr, AS_HELP_STRING(--enable-static-mr,Link mondorestore statically), do_static_mr=$withval, do_static_mr= )
|
---|
| 37 | AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", )
|
---|
| 38 | 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)
|
---|
| 39 | if test x$do_static_mr = xyes; then
|
---|
| 40 | MONDORESTORE_STATIC=-static
|
---|
| 41 | else
|
---|
| 42 | MONDORESTORE_STATIC=
|
---|
| 43 | fi
|
---|
| 44 | AC_SUBST(MONDORESTORE_STATIC)
|
---|
| 45 | AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
|
---|
| 46 |
|
---|
| 47 | # ( 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]) ) )
|
---|
| 48 |
|
---|
| 49 | # Checks for libraries.
|
---|
[423] | 50 | dnl AC_CHECK_LIB([dl], [main])
|
---|
[1] | 51 | AC_CHECK_LIB([newt], [newtInit])
|
---|
| 52 | standardthread=0;
|
---|
| 53 |
|
---|
| 54 | case $build in
|
---|
| 55 | *freebsd*)
|
---|
| 56 | standardthread=0
|
---|
| 57 | 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)
|
---|
| 58 | if test $standardthread -eq 0; then
|
---|
[182] | 59 | CPPFLAGS=$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/pthread/linuxthreads
|
---|
[1] | 60 | PTHREAD="-L/usr/local/lib -llthread -llgcc_r";
|
---|
| 61 | if ! test -f /usr/local/include/pthread/linuxthreads/pthread.h; then
|
---|
| 62 | echo "*** Cannot find pthread.h: are you SURE you have linuxthreads installed?"
|
---|
| 63 | exit 1
|
---|
| 64 | fi
|
---|
| 65 | 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])
|
---|
| 66 | else
|
---|
| 67 | PTHREAD="-lc_r"
|
---|
| 68 | fi
|
---|
| 69 | ;;
|
---|
| 70 | *linux*)
|
---|
| 71 | 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])
|
---|
| 72 | PTHREAD="-lpthread"
|
---|
[2195] | 73 | GCC_MAJ="`gcc -dumpversion 2>&1 | cut -d. -f1`"
|
---|
| 74 | GCC_MIN="`gcc -dumpversion 2>&1 | cut -d. -f2`"
|
---|
[3879] | 75 |
|
---|
| 76 | # Just test for dev machine on x86_64 ubsan used for option -fsanitize=undefined
|
---|
| 77 | if [ -f /usr/lib64/libubsan.so ]; then
|
---|
| 78 | CFLAGS="$CFLAGS -fsanitize=undefined"
|
---|
| 79 | HAVE_UBSAN=1
|
---|
| 80 | else
|
---|
| 81 | HAVE_UBSAN=0
|
---|
| 82 | fi
|
---|
| 83 |
|
---|
| 84 | # Just test for dev machine on x86_64 asan used for option -fsanitize=address
|
---|
| 85 | if [ -f /usr/lib64/libasan.so ]; then
|
---|
| 86 | CFLAGS="$CFLAGS -fsanitize=address"
|
---|
| 87 | HAVE_ASAN=1
|
---|
| 88 | else
|
---|
| 89 | HAVE_ASAN=0
|
---|
| 90 | fi
|
---|
| 91 |
|
---|
| 92 | CFLAGS="$CFLAGS -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wcast-qual -Wswitch-default -Wswitch-enum -Wno-return-type -Wformat=2 -Werror=implicit-function-declaration -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -D_FORTIFY_SOURCE=2 -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,defs -Wl,-z,now -Wl,-z,relro -Wno-discarded-qualifiers" # -Wconversion -Wstrict-prototypes -Werror"
|
---|
[1] | 93 | ;;
|
---|
| 94 | *)
|
---|
| 95 | echo "*** Sorry, only Linux and FreeBSD are supported at this time. Want to help?"
|
---|
| 96 | ;;
|
---|
| 97 | esac
|
---|
| 98 |
|
---|
| 99 | if test "$host_cpu" != "$target_cpu"; then
|
---|
| 100 | host_cpu=$target_cpu
|
---|
| 101 | fi
|
---|
| 102 | case "$host_cpu" in
|
---|
| 103 | i?86*)
|
---|
| 104 | CPPFLAGS="$CPPFLAGS -D__IA32__"
|
---|
| 105 | ;;
|
---|
[1375] | 106 | x86_64*)
|
---|
| 107 | CPPFLAGS="$CPPFLAGS -D__IA32__ -D__X86_64__"
|
---|
| 108 | ;;
|
---|
[1] | 109 | ia64*)
|
---|
| 110 | CPPFLAGS="$CPPFLAGS -D__IA64__"
|
---|
| 111 | ;;
|
---|
| 112 | *)
|
---|
[1375] | 113 | echo "*** Sorry, only Intel Architectures (ia32, x86_64, ia64) are supported at this time. Want to help?"
|
---|
[1] | 114 | ;;
|
---|
| 115 | esac
|
---|
| 116 |
|
---|
| 117 | LIBS="$LIBS $PTHREAD"
|
---|
| 118 | AC_SUBST(LIBS)
|
---|
| 119 |
|
---|
| 120 | # Checks for header files.
|
---|
[3879] | 121 | AC_CHECK_INCLUDES_DEFAULT
|
---|
| 122 | AC_PROG_EGREP
|
---|
| 123 |
|
---|
[1] | 124 | AC_HEADER_SYS_WAIT
|
---|
[3030] | 125 | AC_HEADER_STDBOOL
|
---|
| 126 | AC_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])
|
---|
[1] | 127 |
|
---|
| 128 | # Checks for typedefs, structures, and compiler characteristics.
|
---|
| 129 | AC_C_CONST
|
---|
[3030] | 130 | AC_C_INLINE
|
---|
| 131 | AC_PROG_GCC_TRADITIONAL
|
---|
| 132 | AC_TYPE_MODE_T
|
---|
[1] | 133 | AC_TYPE_OFF_T
|
---|
| 134 | AC_TYPE_PID_T
|
---|
[3030] | 135 | AC_TYPE_SIZE_T
|
---|
| 136 | AC_TYPE_SSIZE_T
|
---|
[3138] | 137 | AC_STRUCT_ST_BLOCKS
|
---|
[1] | 138 |
|
---|
| 139 | # Checks for library functions.
|
---|
| 140 | AC_FUNC_CHOWN
|
---|
| 141 | AC_FUNC_FORK
|
---|
[3030] | 142 | AC_FUNC_FSEEKO
|
---|
[1] | 143 | AC_FUNC_LSTAT
|
---|
| 144 | AC_FUNC_MALLOC
|
---|
[3630] | 145 | AC_FUNC_REALLOC
|
---|
[1] | 146 | AC_FUNC_VPRINTF
|
---|
[3630] | 147 | AC_CHECK_FUNCS([bzero getcwd gethostbyname inet_ntoa memmove memset mkdir mkdtemp mkfifo pathconf rmdir setenv strcasecmp strcspn strchr strdup strerror strncasecmp strrchr strspn strstr uname utime])
|
---|
[1] | 148 |
|
---|
[3630] | 149 | AM_PROG_CC_C_O
|
---|
[3031] | 150 | AC_CONFIG_FILES([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])
|
---|
| 151 | AC_OUTPUT
|
---|