snapraid/configure.ac

135 lines
3.4 KiB
Text
Raw Normal View History

2011-03-01 22:21:30 +01:00
dnl Process this file with autoconf to produce a configure script.
2011-03-06 22:52:50 +01:00
AC_PREREQ([2.65])
2013-09-17 23:33:15 +02:00
AC_INIT([snapraid], [4.1], [], [], [http://snapraid.sourceforge.net])
2011-03-23 20:58:03 +01:00
AM_INIT_AUTOMAKE([foreign no-dependencies -Wall])
2011-03-01 22:21:30 +01:00
AC_CONFIG_SRCDIR([snapraid.c])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
2011-03-12 10:09:59 +01:00
AC_USE_SYSTEM_EXTENSIONS
AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind],[])
AC_CHECK_PROG([WINE],[wine],[wine],[])
AC_CHECK_PROG([ADVD2],[advd2],[advd2],[])
AM_CONDITIONAL(HAVE_ADVD2, [test x"$ADVD2" != x])
2011-03-01 22:21:30 +01:00
dnl Checks for libraries.
AC_SYS_LARGEFILE
dnl Checks for header files.
2011-03-12 10:09:59 +01:00
AC_HEADER_ASSERT
2011-03-01 22:21:30 +01:00
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h limits.h])
AC_CHECK_HEADERS([unistd.h getopt.h fnmatch.h io.h inttypes.h byteswap.h])
2013-08-29 00:23:14 +02:00
AC_CHECK_HEADERS([sys/time.h sys/file.h sys/ioctl.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h])
AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h])
2011-03-01 22:21:30 +01:00
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_C_VOLATILE
AC_TYPE_SIZE_T
2011-03-06 22:52:50 +01:00
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
2011-06-26 17:47:34 +02:00
AC_TYPE_INT8_T
2012-09-19 23:18:47 +02:00
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec, struct stat.st_mtimespec.tv_nsec], [], [], [[
#if HAVE_SYS_TYPES_H
2012-09-19 23:18:47 +02:00
#include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
2012-09-19 23:18:47 +02:00
#include <sys/stat.h>
#endif
#if HAVE_UNISTD_H
2012-09-19 23:18:47 +02:00
#include <unistd.h>
#endif
]])
AC_CHECK_MEMBERS([struct statfs.f_type], [], [], [[
2013-08-29 00:23:14 +02:00
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#if HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#if HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
2012-09-19 23:18:47 +02:00
]])
2011-03-01 22:21:30 +01:00
dnl Checks for library functions.
2011-03-12 10:09:59 +01:00
AC_SYS_LARGEFILE
2011-06-26 17:47:34 +02:00
AC_CHECK_FUNCS([memset strchr strerror strrchr mkdir gettimeofday strtoul])
2011-03-01 22:21:30 +01:00
AC_CHECK_FUNCS([getopt getopt_long snprintf vsnprintf])
AC_CHECK_FUNCS([ftruncate fallocate fsync access posix_fallocate posix_fadvise])
AC_CHECK_FUNCS([pread pwrite getc_unlocked ferror_unlocked fnmatch])
AC_CHECK_FUNCS([futimes futimens futimesat fstatat flock statfs])
2011-03-01 22:21:30 +01:00
dnl Checks for architecture
AC_C_BIGENDIAN
dnl Checks for compiler
AC_CHECK_CC_OPT([-Wall], CFLAGS="$CFLAGS -Wall", [])
2011-03-29 23:55:31 +02:00
AC_CHECK_CC_OPT([-Wextra], CFLAGS="$CFLAGS -Wextra", [])
2011-03-01 22:21:30 +01:00
dnl Checks for test environment
AS_CASE([$host],
[*-*-mingw*], [TESTENV="$WINE"],
[SYMLINK=1]
)
AM_CONDITIONAL(HAVE_SYMLINK, [test x"$SYMLINK" != x])
AC_ARG_ENABLE([profiler],
[AS_HELP_STRING([--enable-profiler],[enable the use of gprof for code coverage])],
[
TESTENV=""
CFLAGS="-O2 -pg -g"
],
[])
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],[enable the use of gcov for code coverage])],
[
TESTENV=""
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
],
[])
AC_ARG_ENABLE([valgrind],
[AS_HELP_STRING([--enable-valgrind],[enable the use of valgrind in testing])],
[
TESTENV="$VALGRIND --leak-check=full --track-fds=yes --error-exitcode=1"
CFLAGS="$CFLAGS -DCHECKER"
],
[])
AC_ARG_ENABLE([sgcheck],
[AS_HELP_STRING([--enable-sgcheck],[enable the use of sgcheck in testing])],
[
TESTENV="$VALGRIND --tool=exp-sgcheck --suppressions=sgcheck.supp --error-exitcode=1"
CFLAGS="$CFLAGS -DCHECKER"
],
[])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[enable debugging])],
[
TESTENV=""
CFLAGS="-O0 -g -Wall -Wextra"
],
[])
AC_ARG_VAR([TESTENV], [Test environment])
2011-03-01 22:21:30 +01:00
AC_CONFIG_FILES([Makefile])
AC_OUTPUT