summaryrefslogtreecommitdiff
path: root/configure.ac
blob: e534af8c4d86577350f95833ee3e321c9d939ce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
dnl Process this file with autoconf to produce a configure script.

AC_INIT("chrpath", "0.13", pere@hungry.com)

AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE("chrpath", "0.13")

AC_CONFIG_SRCDIR(chrpath.c)
AM_CONFIG_HEADER(config.h)

AM_MAINTAINER_MODE

CHRPATH_LDRPATH_OPTION

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([getopt.h elf.h fcntl.h unistd.h link.h sys/link.h])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(void *)

dnl Checks for library functions.
AC_CHECK_FUNCS(getopt_long)

if eval "test x$GCC = xyes"; then
  for flag in \
      -ansi \
      -pedantic \
      -W \
      -Wall \
      -Wcast-align \
      -Wcast-qual \
      -Wcomments \
      -Wmissing-declarations \
      -Wmissing-prototypes \
      -Wpointer-arith \
      -Wreturn-type \
      -Wstrict-prototypes 
  do
    JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
  done
fi

AC_ARG_WITH(coverage, [Enable coverage testing],
[
    JAPHAR_GREP_CFLAGS(-g, [ CFLAGS="$CFLAGS -g" ])
    JAPHAR_GREP_CFLAGS(-fprofile-arcs, [ CFLAGS="$CFLAGS -fprofile-arcs" ])
    JAPHAR_GREP_CFLAGS(-ftest-coverage, [ CFLAGS="$CFLAGS -ftest-coverage" ])
], [])

AC_CONFIG_FILES([
        Makefile \
        testsuite/Makefile \
        deb/Makefile \
        ])
AC_OUTPUT

if test ! -d debian ; then
    ln -s deb debian
fi

echo "Configure status:"
echo "-----------------"
echo " CC     = $CC"
echo " CFLAGS = $CFLAGS"
echo " LDRPATH= $LDRPATH"
echo