2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([GNU Vtable Verification Runtime Library], 1.0,,[libvtv])
6 #AC_INIT(package-unused, version-unused, libvtv)
7 AC_CONFIG_SRCDIR([vtv_rts.h])
12 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
13 AC_ARG_ENABLE(version-specific-runtime-libs,
14 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
16 yes) version_specific_libs=yes ;;
17 no) version_specific_libs=no ;;
18 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
20 [version_specific_libs=no])
21 AC_MSG_RESULT($version_specific_libs)
23 # Do not delete or change the following two lines. For why, see
24 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
26 target_alias=${target_alias-$host_alias}
27 AC_SUBST(target_alias)
28 GCC_LIBSTDCXX_RAW_CXX_FLAGS
30 # Use same top-level configure hooks in libgcc/libstdc++/libvtv.
31 AC_MSG_CHECKING([for --enable-vtable-verify])
32 AC_ARG_ENABLE(vtable-verify,
33 [ --enable-vtable-verify Enable vtable verification feature ],
35 yes) enable_vtable_verify=yes ;;
36 no) enable_vtable_verify=no ;;
37 *) enable_vtable_verify=no;;
39 [enable_vtable_verify=no])
40 AC_MSG_RESULT($enable_vtable_verify)
44 AC_MSG_CHECKING([for host support for vtable verification])
45 . ${srcdir}/configure.tgt
46 AC_MSG_RESULT($VTV_SUPPORTED)
48 # Decide if it's usable.
50 if test "x$VTV_SUPPORTED" = "xyes"; then
51 if test "x$enable_vtable_verify" = "xyes"; then
53 AC_MSG_NOTICE(using vtable verification)
56 AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes)
58 AM_INIT_AUTOMAKE(foreign no-dist)
59 AM_ENABLE_MULTILIB(, ..)
64 # Calculate toolexeclibdir
65 # Also toolexecdir, though it's only used in toolexeclibdir
66 case ${version_specific_libs} in
68 # Need the gcc compiler version to know where to install libraries
69 # and header files if --enable-version-specific-runtime-libs option
71 toolexecdir='$(libdir)/gcc/$(target_alias)'
72 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
75 if test -n "$with_cross_host" &&
76 test x"$with_cross_host" != x"no"; then
77 # Install a library built with a cross compiler in tooldir, not libdir.
78 toolexecdir='$(exec_prefix)/$(target_alias)'
79 toolexeclibdir='$(toolexecdir)/lib'
81 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
82 toolexeclibdir='$(libdir)'
84 multi_os_directory=`$CC -print-multi-os-directory`
85 case $multi_os_directory in
86 .) ;; # Avoid trailing /.
87 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
92 AC_SUBST(toolexeclibdir)
95 AC_CHECK_FUNCS([__secure_getenv])
98 AC_CHECK_FUNCS([secure_getenv])
100 # Check for programs.
101 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
102 m4_define([_AC_ARG_VAR_PRECIOUS],[])
105 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
112 # Newer automakes demand CCAS and CCASFLAGS.
114 : ${CCASFLAGS='$(CFLAGS)'}
118 AC_CHECK_TOOL(AS, as)
119 AC_CHECK_TOOL(AR, ar)
120 AC_CHECK_TOOL(RANLIB, ranlib, :)
125 AC_SUBST(enable_shared)
126 AC_SUBST(enable_static)
128 # For libtool versioning info, format is CURRENT:REVISION:AGE
129 libtool_VERSION=1:0:0
130 AC_SUBST(libtool_VERSION)
132 XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
135 if test "${multilib}" = "yes"; then
136 multilib_arg="--enable-multilib"
141 AC_CONFIG_FILES([Makefile])
143 if test "x$VTV_SUPPORTED" = "xyes"; then
144 AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]),
145 [cat > vpsed$$ << \_EOF
146 s!`test -f '$<' || echo '$(srcdir)/'`!!
148 sed -f vpsed$$ $ac_file > tmp$$
151 echo 'MULTISUBDIR =' >> $ac_file
153 . ${multi_basedir}/config-ml.in
154 AS_UNSET([ml_norecursion])