Use install-sh to install dyninst libraries and includes rather than cp
[dyninst.git] / parseThat / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([parseThat], [1.0])
3 AC_CONFIG_SRCDIR([src/config.C])
4 AC_PREFIX_DEFAULT([.])
5 AC_CONFIG_AUX_DIR([../autodyninst])
6
7 AC_ARG_WITH(dyninst,
8             [AS_HELP_STRING([--with-dyninst],[Base directory to look for dyninst headers and libraries])],
9             [DYNINST_LIB="${withval}/${PLATFORM}/lib"
10              DYNINST_INC="${withval}/include"],)
11
12 AC_ARG_WITH(dyninst-lib,
13             [AS_HELP_STRING([--with-dyninst-lib],[Directory to look for dyninst libraries])],
14             [DYNINST_LIB="${withval}"],)
15
16 AC_ARG_WITH(dyninst-include,
17             [AS_HELP_STRING([--with-dyninst-include],[Directory to look for dyninst headers])],
18             [DYNINST_INC="${withval}"],)
19
20 AC_ARG_WITH(dwarf-lib,
21             [AS_HELP_STRING([--with-dwarf-include],[Directory to look for libdwarf])],
22             [DWARF_LIB="${withval}"],)
23
24 AC_ARG_WITH(elf-lib,
25             [AS_HELP_STRING([--with-elf-include],[Directory to look for libelf])],
26             [ELF_LIB="${withval}"],)
27
28 AC_ARG_WITH(liberty-lib,
29             [AS_HELP_STRING([--with-liberty-lib],[Link string to use for libiberty])],
30             [LIBERTY_LIB="${withval}"],)
31
32 if test -n ${DYNINST_ROOT}; then
33    # Add search paths to CPPFLAGS and LDFLAGS.
34    if test -z ${DYNINST_LIB}; then
35       DYNINST_LIB="${DYNINST_ROOT}/${PLATFORM}/lib"
36    fi
37    if test -z ${DYNINST_INC}; then
38       DYNINST_INC="${DYNINST_ROOT}/include"
39    fi
40 fi
41
42 AC_SUBST([LDFLAGS], ["-L${DYNINST_LIB} ${LDFLAGS}"])
43 AC_SUBST([DWARFFLAGS], ["${DWARF_LIB}"])
44 AC_SUBST([ELFFLAGS], ["${ELF_LIB}"])
45 AC_SUBST([LIBERTYFLAGS], ["${LIBERTY_LIB}"])
46 AC_SUBST([CPPFLAGS], ["-I${DYNINST_INC} ${CPPFLAGS}"])
47
48 # Generate host string.
49 AC_CANONICAL_HOST()
50
51 # Build all configure tests with C++ compiler.
52 AC_LANG([C++])
53
54 # sha1.C requres these system files and endianess to be tested.
55 AC_CHECK_HEADERS([inttypes.h], [], [], [// Do not use default includes])
56 AC_CHECK_HEADERS([stdint.h], [], [], [// Do not use default includes])
57 AC_C_BIGENDIAN()
58
59 # Search for Dyninst in all the right places.
60 AC_CHECK_HEADER([BPatch.h], [],
61                 [AC_MSG_ERROR([Cannot find DyninstAPI library include files.])],
62                 [// Do not use default includes])
63
64 # Check if Dyninst is version 5.0+
65 AC_CHECK_HEADERS([BPatch_process.h],
66                  [AC_SUBST([DYNINST_VER], [5])],
67                  [AC_SUBST([DYNINST_VER], [4])],
68                  [// Do not use default includes])
69
70 # Find appropriate install program
71 AC_PROG_INSTALL()
72
73 AC_CONFIG_FILES([Makefile])
74 AC_OUTPUT()