Imported Upstream version 0.16
[platform/upstream/chrpath.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(chrpath, 0.16, chrpath-devel@lists.alioth.debian.org)
4
5 AC_CANONICAL_TARGET
6
7 AM_INIT_AUTOMAKE("chrpath", "0.16")
8
9 AC_CONFIG_SRCDIR(chrpath.c)
10 AM_CONFIG_HEADER(config.h)
11
12 AM_MAINTAINER_MODE
13
14 CHRPATH_LDRPATH_OPTION
15
16 dnl Checks for programs.
17 AC_PROG_CC
18 AC_PROG_INSTALL
19
20 dnl Checks for libraries.
21
22 dnl Checks for header files.
23 AC_HEADER_STDC
24 AC_CHECK_HEADERS([getopt.h elf.h fcntl.h unistd.h link.h sys/link.h])
25
26 dnl Checks for typedefs, structures, and compiler characteristics.
27 AC_C_CONST
28 AC_C_BIGENDIAN
29 AC_CHECK_SIZEOF(void *)
30
31 dnl Checks for library functions.
32 AC_CHECK_FUNCS(getopt_long)
33
34 if eval "test x$GCC = xyes"; then
35   for flag in \
36       -W \
37       -Wall \
38       -Wcast-align \
39       -Wcast-qual \
40       -Wcomments \
41       -Wmissing-declarations \
42       -Wmissing-prototypes \
43       -Wpointer-arith \
44       -Wreturn-type \
45       -Wstrict-prototypes 
46   do
47     JAPHAR_GREP_CFLAGS($flag, [ CFLAGS="$CFLAGS $flag" ])
48   done
49 fi
50
51 AC_ARG_WITH(coverage, [Enable coverage testing],
52 [
53     JAPHAR_GREP_CFLAGS(-g, [ CFLAGS="$CFLAGS -g" ])
54     JAPHAR_GREP_CFLAGS(-fprofile-arcs, [ CFLAGS="$CFLAGS -fprofile-arcs" ])
55     JAPHAR_GREP_CFLAGS(-ftest-coverage, [ CFLAGS="$CFLAGS -ftest-coverage" ])
56 ], [])
57
58 AC_CONFIG_FILES([
59         Makefile \
60         testsuite/Makefile \
61         deb/Makefile \
62         ])
63 AC_OUTPUT
64
65 if test ! -d debian ; then
66     ln -s deb debian
67 fi
68
69 echo "Configure status:"
70 echo "-----------------"
71 echo " CC     = $CC"
72 echo " CFLAGS = $CFLAGS"
73 echo " LDRPATH= $LDRPATH"
74 echo