1# -*- Autoconf -*- 2# Process this file with autoconf to produce a configure script. 3 4AC_PREREQ([2.64]) 5AC_INIT([GNU Vtable Verification Runtime Library], 1.0,,[libvtv]) 6#AC_INIT(package-unused, version-unused, libvtv) 7AC_CONFIG_SRCDIR([vtv_rts.h]) 8 9# ------- 10# Options 11# ------- 12AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) 13AC_ARG_ENABLE(version-specific-runtime-libs, 14[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], 15[case "$enableval" in 16 yes) version_specific_libs=yes ;; 17 no) version_specific_libs=no ;; 18 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; 19 esac], 20[version_specific_libs=no]) 21AC_MSG_RESULT($version_specific_libs) 22 23# Do not delete or change the following two lines. For why, see 24# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html 25AC_CANONICAL_SYSTEM 26target_alias=${target_alias-$host_alias} 27AC_SUBST(target_alias) 28GCC_LIBSTDCXX_RAW_CXX_FLAGS 29 30# Use same top-level configure hooks in libgcc/libstdc++/libvtv. 31AC_MSG_CHECKING([for --enable-vtable-verify]) 32AC_ARG_ENABLE(vtable-verify, 33[ --enable-vtable-verify Enable vtable verification feature ], 34[case "$enableval" in 35 yes) enable_vtable_verify=yes ;; 36 no) enable_vtable_verify=no ;; 37 *) enable_vtable_verify=no;; 38 esac], 39[enable_vtable_verify=no]) 40AC_MSG_RESULT($enable_vtable_verify) 41 42# See if supported. 43unset VTV_SUPPORTED 44AC_MSG_CHECKING([for host support for vtable verification]) 45. ${srcdir}/configure.tgt 46AC_MSG_RESULT($VTV_SUPPORTED) 47 48# Decide if it's usable. 49use_vtable_verify=no 50if test "x$VTV_SUPPORTED" = "xyes"; then 51 if test "x$enable_vtable_verify" = "xyes"; then 52 use_vtable_verify=yes 53 AC_MSG_NOTICE(using vtable verification) 54 fi 55fi 56AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes) 57 58AM_INIT_AUTOMAKE(foreign no-dist) 59AM_ENABLE_MULTILIB(, ..) 60AM_MAINTAINER_MODE 61 62LIBVTV_CONFIGURE 63 64# Calculate toolexeclibdir 65# Also toolexecdir, though it's only used in toolexeclibdir 66case ${version_specific_libs} in 67 yes) 68 # Need the gcc compiler version to know where to install libraries 69 # and header files if --enable-version-specific-runtime-libs option 70 # is selected. 71 toolexecdir='$(libdir)/gcc/$(target_alias)' 72 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' 73 ;; 74 no) 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' 80 else 81 toolexecdir='$(libdir)/gcc-lib/$(target_alias)' 82 toolexeclibdir='$(libdir)' 83 fi 84 multi_os_directory=`$CC -print-multi-os-directory` 85 case $multi_os_directory in 86 .) ;; # Avoid trailing /. 87 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; 88 esac 89 ;; 90esac 91AC_SUBST(toolexecdir) 92AC_SUBST(toolexeclibdir) 93 94AC_GNU_SOURCE 95AC_CHECK_FUNCS([__secure_getenv]) 96 97AC_GNU_SOURCE 98AC_CHECK_FUNCS([secure_getenv]) 99 100# Check for programs. 101m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) 102m4_define([_AC_ARG_VAR_PRECIOUS],[]) 103AC_PROG_CC 104AC_PROG_CXX 105m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) 106 107AM_PROG_CC_C_O 108 109AC_SUBST(CFLAGS) 110AC_SUBST(CXXFLAGS) 111 112# Newer automakes demand CCAS and CCASFLAGS. 113: ${CCAS='$(CC)'} 114: ${CCASFLAGS='$(CFLAGS)'} 115AC_SUBST(CCAS) 116AC_SUBST(CCASFLAGS) 117 118AC_CHECK_TOOL(AS, as) 119AC_CHECK_TOOL(AR, ar) 120AC_CHECK_TOOL(RANLIB, ranlib, :) 121 122# Configure libtool 123AC_LIBTOOL_DLOPEN 124AM_PROG_LIBTOOL 125ACX_LT_HOST_FLAGS 126AC_SUBST(enable_shared) 127AC_SUBST(enable_static) 128 129# For libtool versioning info, format is CURRENT:REVISION:AGE 130libtool_VERSION=1:0:0 131AC_SUBST(libtool_VERSION) 132 133XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions" 134AC_SUBST(XCFLAGS) 135 136if test "${multilib}" = "yes"; then 137 multilib_arg="--enable-multilib" 138else 139 multilib_arg= 140fi 141 142AC_CONFIG_FILES([Makefile]) 143 144if test "x$VTV_SUPPORTED" = "xyes"; then 145 AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]), 146 [cat > vpsed$$ << \_EOF 147s!`test -f '$<' || echo '$(srcdir)/'`!! 148_EOF 149 sed -f vpsed$$ $ac_file > tmp$$ 150 mv tmp$$ $ac_file 151 rm vpsed$$ 152 echo 'MULTISUBDIR =' >> $ac_file 153 ml_norecursion=yes 154 . ${multi_basedir}/config-ml.in 155 AS_UNSET([ml_norecursion]) 156]) 157fi 158 159case "$target_os" in 160 cygwin*|mingw32*) 161 vtv_cygmin="yes" 162 ;; 163 *) 164 vtv_cygmin="no" 165 ;; 166esac 167 168AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes) 169 170AC_OUTPUT 171