configure.ac revision 1.1
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.64])
5AC_INIT(package-unused, version-unused, libsanitizer)
6AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
7
8AM_ENABLE_MULTILIB(, ..)
9
10AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
11AC_ARG_ENABLE(version-specific-runtime-libs,
12[  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
13[case "$enableval" in
14 yes) version_specific_libs=yes ;;
15 no)  version_specific_libs=no ;;
16 *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
17 esac],
18[version_specific_libs=no])
19AC_MSG_RESULT($version_specific_libs)
20
21# Do not delete or change the following two lines.  For why, see
22# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
23AC_CANONICAL_SYSTEM
24target_alias=${target_alias-$host_alias}
25AC_SUBST(target_alias)
26GCC_LIBSTDCXX_RAW_CXX_FLAGS
27
28AM_INIT_AUTOMAKE(foreign no-dist)
29AM_MAINTAINER_MODE
30
31# Calculate toolexeclibdir
32# Also toolexecdir, though it's only used in toolexeclibdir
33case ${version_specific_libs} in
34  yes)
35    # Need the gcc compiler version to know where to install libraries
36    # and header files if --enable-version-specific-runtime-libs option
37    # is selected.
38    toolexecdir='$(libdir)/gcc/$(target_alias)'
39    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
40    ;;
41  no)
42    if test -n "$with_cross_host" &&
43       test x"$with_cross_host" != x"no"; then
44      # Install a library built with a cross compiler in tooldir, not libdir.
45      toolexecdir='$(exec_prefix)/$(target_alias)'
46      toolexeclibdir='$(toolexecdir)/lib'
47    else
48      toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
49      toolexeclibdir='$(libdir)'
50    fi
51    multi_os_directory=`$CC -print-multi-os-directory`
52    case $multi_os_directory in
53      .) ;; # Avoid trailing /.
54      *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
55    esac
56    ;;
57esac
58AC_SUBST(toolexecdir)
59AC_SUBST(toolexeclibdir)
60
61# Checks for programs.
62AC_PROG_CC
63AC_PROG_CXX
64AM_PROG_AS
65
66AC_LIBTOOL_DLOPEN
67AM_PROG_LIBTOOL
68
69AC_SUBST(enable_shared)
70AC_SUBST(enable_static)
71
72AC_CHECK_SIZEOF([void *])
73
74if test "${multilib}" = "yes"; then
75  multilib_arg="--enable-multilib"
76else
77  multilib_arg=
78fi
79
80# Get target configury.
81unset TSAN_SUPPORTED
82. ${srcdir}/configure.tgt
83AM_CONDITIONAL(TSAN_SUPPORTED, [test "x$TSAN_SUPPORTED" = "xyes"])
84
85case "$host" in
86  *-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
87  *) MAC_INTERPOSE=false ;;
88esac
89AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
90
91AC_CONFIG_FILES([Makefile])
92
93AC_CONFIG_FILES(AC_FOREACH([DIR], [interception sanitizer_common asan], [DIR/Makefile ]),
94  [cat > vpsed$$ << \_EOF
95s!`test -f '$<' || echo '$(srcdir)/'`!!
96_EOF
97   sed -f vpsed$$ $ac_file > tmp$$
98   mv tmp$$ $ac_file
99   rm vpsed$$
100   echo 'MULTISUBDIR =' >> $ac_file
101   ml_norecursion=yes
102   . ${multi_basedir}/config-ml.in
103   AS_UNSET([ml_norecursion])
104])
105
106if test "x$TSAN_SUPPORTED" = "xyes"; then
107  AC_CONFIG_FILES(AC_FOREACH([DIR], [tsan], [DIR/Makefile ]), 
108    [cat > vpsed$$ << \_EOF
109s!`test -f '$<' || echo '$(srcdir)/'`!!
110_EOF
111    sed -f vpsed$$ $ac_file > tmp$$
112    mv tmp$$ $ac_file
113    rm vpsed$$
114    echo 'MULTISUBDIR =' >> $ac_file
115    ml_norecursion=yes
116    . ${multi_basedir}/config-ml.in
117    AS_UNSET([ml_norecursion])
118])
119fi
120
121AC_OUTPUT
122