If an .so file is present for LIBDWARF, set LIBDWARFSTATIC to false, etc.
[dyninst.git] / autodyninst / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4 AC_INIT(configure.in)
5
6 AC_PROG_CXX(g++)
7 AC_LANG(C++)
8
9 dnl === CONFIGURE OPTIONS
10
11 AC_ARG_WITH(package-base,
12            [AS_HELP_STRING([--with-package-base],[Base directory to look for packages])],
13            [PACKAGE_BASE="${withval}";],
14            [PACKAGE_BASE="";])
15
16 AC_ARG_WITH(tcl83,
17             [AS_HELP_STRING([--with-tcl83],[Use Tcl/Tk 8.3])],
18             [TCL_VERSION="tcl8.3"; USE_TCL83="${withval}";],
19             [TCL_VERSION="tcl8.4"; USE_TCL83="false";])
20 AC_ARG_WITH(tcltk-incdir,
21             [AS_HELP_STRING([--with-tcltk-incdir],[TCL/TK include directory])],
22             [TCLTK_INC_DIR="${withval}";],
23            [AC_ARG_WITH(package-base,[],[TCLTK_INC_DIR="${PACKAGE_BASE}/tcl8.4.5/include"], [TCLTK_INC_DIR=""])])
24 AC_ARG_WITH(tcltk-libdir,
25             [AS_HELP_STRING([--with-tcltk-libdir],[TCL/TK library directory])],
26             [TCLTK_LIB_DIR="${withval}";],
27            [AC_ARG_WITH(package-base,[],[TCLTK_LIB_DIR="${PACKAGE_BASE}/tcl8.4.5/lib"], [TCLTK_LIB_DIR=""])])
28
29 PD_SOFT_CHECK_INC_DIR($TCLTK_INC_DIR, [tcl.h])
30 PD_SOFT_CHECK_LIB_DIR($TCLTK_LIB_DIR,$TCL_VERSION,[Tcl_Eval])
31 LIBTCLTKSTATIC=`${PWD}/autodyninst/check_lib_type.py tcl ${TCLTK_LIB_DIR}`
32 AC_SUBST(LIBTCLTKSTATIC)
33
34 AC_SUBST(USE_TCL83)
35 AC_SUBST(TCLTK_INC_DIR)
36 AC_SUBST(TCLTK_LIB_DIR)
37
38 AC_ARG_WITH(libelf-incdir,
39             [AS_HELP_STRING([--with-libelf-incdir],[LIBELF include directory])],
40             [LIBELF_INC_DIR="${withval}";],
41            [AC_ARG_WITH(package-base,[],[LIBELF_INC_DIR="${PACKAGE_BASE}/libelf/include"], [LIBELF_INC_DIR=""])])
42 AC_ARG_WITH(libelf-libdir,
43             [AS_HELP_STRING([--with-libelf-libdir],[LIBELF library directory])],
44             [LIBELF_LIB_DIR="${withval}";],
45            [AC_ARG_WITH(package-base,[],[LIBELF_LIB_DIR="${PACKAGE_BASE}/libelf/lib"], [LIBELF_LIB_DIR=""])])
46
47 PD_CHECK_INC_DIR($LIBELF_INC_DIR, [libelf.h])
48 PD_CHECK_LIB_DIR($LIBELF_LIB_DIR,[elf],[elf_memory])
49 LIBELFSTATIC=`${PWD}/autodyninst/check_lib_type.py elf ${LIBELF_LIB_DIR}`
50 AC_SUBST(LIBELFSTATIC)
51
52 AC_SUBST(LIBELF_INC_DIR)
53 AC_SUBST(LIBELF_LIB_DIR)
54
55 AC_ARG_WITH(libdwarf-incdir,
56             [AS_HELP_STRING([--with-libdwarf-incdir],[LIBDWARF include directory])],
57             [LIBDWARF_INC_DIR="${withval}";],
58            [AC_ARG_WITH(package-base,[],[LIBDWARF_INC_DIR="${PACKAGE_BASE}/libdwarf/include"], [LIBDWARF_INC_DIR=""])])
59
60 AC_ARG_WITH(libdwarf-libdir,
61             [AS_HELP_STRING([--with-libdwarf-libdir],[LIBDWARF library directory])],
62             [LIBDWARF_LIB_DIR="${withval}";],
63            [AC_ARG_WITH(package-base,[],[LIBDWARF_LIB_DIR="${PACKAGE_BASE}/libdwarf/lib"], [LIBDWARF_LIB_DIR=""])])
64
65 PD_CHECK_INC_DIR($LIBDWARF_INC_DIR,[libdwarf.h])
66 PD_CHECK_LIB_DIR($LIBDWARF_LIB_DIR,[dwarf],[dwarf_add_arange],$LIBDWARF_LIB_DIR,[-lelf])
67 LIBDWARFSTATIC=`${PWD}/autodyninst/check_lib_type.py dwarf ${LIBDWARF_LIB_DIR}`
68 AC_SUBST(LIBDWARFSTATIC)
69
70 AC_SUBST(LIBDWARF_INC_DIR)
71 AC_SUBST(LIBDWARF_LIB_DIR)
72
73 AC_ARG_WITH(libxml2-incdir,
74             [AS_HELP_STRING([--with-libxml2-incdir],[LIBXML2 include directory])],
75             [LIBXML2_INC_DIR="${withval}";],
76            [AC_ARG_WITH(package-base,[],[LIBXML2_INC_DIR="${PACKAGE_BASE}/libxml2/include/libxml2"], [LIBXML2_INC_DIR=""])])
77
78 AC_ARG_WITH(libxml2-libdir,
79             [AS_HELP_STRING([--with-libxml2-libdir],[LIBXML2 library directory])],
80             [LIBXML2_LIB_DIR="${withval}";],
81            [AC_ARG_WITH(package-base,[],[LIBXML2_LIB_DIR="${PACKAGE_BASE}/libxml2/lib"], [LIBXML2_LIB_DIR=""])])
82
83 PD_CHECK_INC_DIR($LIBXML2_INC_DIR, [libxml/xmlschemas.h])
84 PD_CHECK_LIB_DIR($LIBXML2_LIB_DIR,[xml2],[xmlAddID])
85
86 AC_SUBST(LIBXML2_INC_DIR)
87 AC_SUBST(LIBXML2_LIB_DIR)
88
89 AC_ARG_WITH(libunwind-incdir,
90             [AS_HELP_STRING([--with-libunwind-incdir],[LIBUNWIND include directory])],
91             [LIBUNWIND_INC_DIR="${withval}";],
92            [AC_ARG_WITH(package-base,[],[LIBUNWIND_INC_DIR="${PACKAGE_BASE}/libunwind/include"], [LIBUNWIND_INC_DIR=""])])
93
94 AC_ARG_WITH(libunwind-libdir,
95             [AS_HELP_STRING([--with-libunwind-libdir],[LIBUNWIND library directory])],
96             [LIBUNWIND_LIB_DIR="${withval}";],
97            [AC_ARG_WITH(package-base,[],[LIBUNWIND_LIB_DIR="${PACKAGE_BASE}/libunwind/lib"], [LIBUNWIND_LIB_DIR=""])])
98
99 AC_CANONICAL_HOST
100 case $host in
101 #     ia64-*-*-*) PD_CHECK_LIB_DIR(${LIBUNWIND_LIB_DIR}, [unwind], [ia64_read_only_reg]) ;;
102      ia64-*-*-*) PD_CHECK_INC_DIR(${LIBUNWIND_INC_DIR}, [libunwind.h]) ;;
103 #     ia64-*-*-*) AC_CHECK_TYPE([unw_dyn_region_info_t], [], [AC_MSG_ERROR([cannot find unw_dyn_region_info_t in libunwind.h])], [${LIBUNWIND_INC_DIR}/libunwind.h]) ;;
104      *) ;;
105 esac
106
107 AC_SUBST(LIBUNWIND_INC_DIR)
108 AC_SUBST(LIBUNWIND_LIB_DIR)
109
110 AC_ARG_WITH(libflex-libdir,
111             [AS_HELP_STRING([--with-libflex-libdir],[Absolute path to flex library])],
112             [LIBFLEX_LIB_DIR="${withval}";],
113            [AC_ARG_WITH(package-base,[],[LIBFLEX_LIB_DIR="${PACKAGE_BASE}/libflex/lib"],[LIBFLEX_LIB_DIR=""])])
114
115 PD_CHECK_LIB_DIR(${LIBFLEX_LIB_DIR}, [fl], [yywrap])
116 AC_SUBST(LIBFLEX_LIB_DIR)
117
118 AC_PATH_PROG(NASM, nasm, "", "${PACKAGE_BASE}/nasm/bin:$PATH")
119 AC_SUBST(NASM)
120
121
122 AC_MSG_CHECKING([whether to use MM timer])
123 case $host in
124      ia64-*-*-*) MMTIMER=true ;;
125      *)    MMTIMER=false ;;
126 esac
127 AC_MSG_RESULT(${MMTIMER})
128 AC_SUBST([MMTIMER])
129
130 AC_CHECK_FILE("${PACKAGE_BASE}/papi-3.0.0-test/papi.c",
131         [PAPI_ROOT="${PACKAGE_BASE}/papi-3.0.0-test/"],
132         [PAPI_ROOT=""])
133
134 AC_SUBST([PAPI_ROOT])
135 AC_CONFIG_FILES([make.config.local:make.config.local.in ])
136 AC_OUTPUT