2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(package-unused, version-unused, libsanitizer)
6 AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
8 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
9 AC_ARG_ENABLE(version-specific-runtime-libs,
10 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
12 yes) version_specific_libs=yes ;;
13 no) version_specific_libs=no ;;
14 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
16 [version_specific_libs=no])
17 AC_MSG_RESULT($version_specific_libs)
19 # Do not delete or change the following two lines. For why, see
20 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
22 target_alias=${target_alias-$host_alias}
23 AC_SUBST(target_alias)
24 GCC_LIBSTDCXX_RAW_CXX_FLAGS
26 AM_INIT_AUTOMAKE(foreign no-dist)
27 AM_ENABLE_MULTILIB(, ..)
30 # Calculate toolexeclibdir
31 # Also toolexecdir, though it's only used in toolexeclibdir
32 case ${version_specific_libs} in
34 # Need the gcc compiler version to know where to install libraries
35 # and header files if --enable-version-specific-runtime-libs option
37 toolexecdir='$(libdir)/gcc/$(target_alias)'
38 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
41 if test -n "$with_cross_host" &&
42 test x"$with_cross_host" != x"no"; then
43 # Install a library built with a cross compiler in tooldir, not libdir.
44 toolexecdir='$(exec_prefix)/$(target_alias)'
45 toolexeclibdir='$(toolexecdir)/lib'
47 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
48 toolexeclibdir='$(libdir)'
50 multi_os_directory=`$CC -print-multi-os-directory`
51 case $multi_os_directory in
52 .) ;; # Avoid trailing /.
53 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
58 AC_SUBST(toolexeclibdir)
60 # Checks for programs.
68 AC_SUBST(enable_shared)
69 AC_SUBST(enable_static)
71 AC_CHECK_SIZEOF([void *])
73 if test "${multilib}" = "yes"; then
74 multilib_arg="--enable-multilib"
79 # Get target configury.
82 . ${srcdir}/configure.tgt
83 AM_CONDITIONAL(TSAN_SUPPORTED, [test "x$TSAN_SUPPORTED" = "xyes"])
84 AM_CONDITIONAL(LSAN_SUPPORTED, [test "x$LSAN_SUPPORTED" = "xyes"])
87 *-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
88 *) MAC_INTERPOSE=false ;;
90 AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
92 AC_CONFIG_FILES([Makefile])
94 AC_CONFIG_FILES(AC_FOREACH([DIR], [interception sanitizer_common lsan asan ubsan], [DIR/Makefile ]),
95 [cat > vpsed$$ << \_EOF
96 s!`test -f '$<' || echo '$(srcdir)/'`!!
98 sed -f vpsed$$ $ac_file > tmp$$
101 echo 'MULTISUBDIR =' >> $ac_file
103 . ${multi_basedir}/config-ml.in
104 AS_UNSET([ml_norecursion])
107 if test "x$TSAN_SUPPORTED" = "xyes"; then
108 AC_CONFIG_FILES(AC_FOREACH([DIR], [tsan], [DIR/Makefile ]),
109 [cat > vpsed$$ << \_EOF
110 s!`test -f '$<' || echo '$(srcdir)/'`!!
112 sed -f vpsed$$ $ac_file > tmp$$
115 echo 'MULTISUBDIR =' >> $ac_file
117 . ${multi_basedir}/config-ml.in
118 AS_UNSET([ml_norecursion])