| 1 |
# -*- Autoconf -*- |
| 2 |
# Process this file with autoconf to produce a configure script. |
| 3 |
|
| 4 |
AC_INIT([GNU Vtable Verification Runtime Library], 1.0,,[libvtv]) |
| 5 |
#AC_INIT(package-unused, version-unused, libvtv) |
| 6 |
AC_CONFIG_SRCDIR([vtv_rts.h]) |
| 7 |
|
| 8 |
AM_ENABLE_MULTILIB(, ..) |
| 9 |
|
| 10 |
# ------- |
| 11 |
# Options |
| 12 |
# ------- |
| 13 |
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) |
| 14 |
AC_ARG_ENABLE(version-specific-runtime-libs, |
| 15 |
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], |
| 16 |
[case "$enableval" in |
| 17 |
yes) version_specific_libs=yes ;; |
| 18 |
no) version_specific_libs=no ;; |
| 19 |
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; |
| 20 |
esac], |
| 21 |
[version_specific_libs=no]) |
| 22 |
AC_MSG_RESULT($version_specific_libs) |
| 23 |
|
| 24 |
# Do not delete or change the following two lines. For why, see |
| 25 |
# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html |
| 26 |
AC_CANONICAL_SYSTEM |
| 27 |
target_alias=${target_alias-$host_alias} |
| 28 |
AC_SUBST(target_alias) |
| 29 |
GCC_LIBSTDCXX_RAW_CXX_FLAGS |
| 30 |
|
| 31 |
AC_USE_SYSTEM_EXTENSIONS |
| 32 |
|
| 33 |
# Use same top-level configure hooks in libgcc/libstdc++/libvtv. |
| 34 |
AC_MSG_CHECKING([for --enable-vtable-verify]) |
| 35 |
AC_ARG_ENABLE(vtable-verify, |
| 36 |
[ --enable-vtable-verify Enable vtable verification feature ], |
| 37 |
[case "$enableval" in |
| 38 |
yes) enable_vtable_verify=yes ;; |
| 39 |
no) enable_vtable_verify=no ;; |
| 40 |
*) enable_vtable_verify=no;; |
| 41 |
esac], |
| 42 |
[enable_vtable_verify=no]) |
| 43 |
AC_MSG_RESULT($enable_vtable_verify) |
| 44 |
|
| 45 |
# See if supported. |
| 46 |
unset VTV_SUPPORTED |
| 47 |
AC_MSG_CHECKING([for host support for vtable verification]) |
| 48 |
. ${srcdir}/configure.tgt |
| 49 |
case ${host} in |
| 50 |
*-*-solaris2*) |
| 51 |
# libvtv requires init priority support, which depends on the linker |
| 52 |
# used on Solaris. |
| 53 |
AC_CACHE_CHECK(for init priority support, libvtv_cv_init_priority, [ |
| 54 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, |
| 55 |
[[void ip (void) __attribute__ ((constructor (1)));]])], |
| 56 |
[libgcc_cv_init_priority=yes],[libgcc_cv_init_priority=no])]) |
| 57 |
if test x$libvtv_cv_init_priority = xno; then |
| 58 |
VTV_SUPPORTED=no |
| 59 |
fi |
| 60 |
# FIXME: Maybe check for dl_iterate_phdr, too? Should be covered by |
| 61 |
# configure.tgt restricting to libvtv to Solaris 11+. |
| 62 |
;; |
| 63 |
esac |
| 64 |
AC_MSG_RESULT($VTV_SUPPORTED) |
| 65 |
|
| 66 |
# Decide if it's usable. |
| 67 |
use_vtable_verify=no |
| 68 |
if test "x$VTV_SUPPORTED" = "xyes"; then |
| 69 |
if test "x$enable_vtable_verify" = "xyes"; then |
| 70 |
use_vtable_verify=yes |
| 71 |
AC_MSG_NOTICE(using vtable verification) |
| 72 |
fi |
| 73 |
fi |
| 74 |
AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes) |
| 75 |
|
| 76 |
AM_INIT_AUTOMAKE(foreign no-dist) |
| 77 |
AM_MAINTAINER_MODE |
| 78 |
|
| 79 |
LIBVTV_CONFIGURE |
| 80 |
|
| 81 |
GCC_WITH_TOOLEXECLIBDIR |
| 82 |
|
| 83 |
# Calculate toolexeclibdir |
| 84 |
# Also toolexecdir, though it's only used in toolexeclibdir |
| 85 |
case ${version_specific_libs} in |
| 86 |
yes) |
| 87 |
# Need the gcc compiler version to know where to install libraries |
| 88 |
# and header files if --enable-version-specific-runtime-libs option |
| 89 |
# is selected. |
| 90 |
toolexecdir='$(libdir)/gcc/$(target_alias)' |
| 91 |
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' |
| 92 |
;; |
| 93 |
no) |
| 94 |
if test -n "$with_cross_host" && |
| 95 |
test x"$with_cross_host" != x"no"; then |
| 96 |
# Install a library built with a cross compiler in tooldir, not libdir. |
| 97 |
toolexecdir='$(exec_prefix)/$(target_alias)' |
| 98 |
case ${with_toolexeclibdir} in |
| 99 |
no) |
| 100 |
toolexeclibdir='$(toolexecdir)/lib' |
| 101 |
;; |
| 102 |
*) |
| 103 |
toolexeclibdir=${with_toolexeclibdir} |
| 104 |
;; |
| 105 |
esac |
| 106 |
else |
| 107 |
toolexecdir='$(libdir)/gcc-lib/$(target_alias)' |
| 108 |
toolexeclibdir='$(libdir)' |
| 109 |
fi |
| 110 |
multi_os_directory=`$CC -print-multi-os-directory` |
| 111 |
case $multi_os_directory in |
| 112 |
.) ;; # Avoid trailing /. |
| 113 |
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; |
| 114 |
esac |
| 115 |
;; |
| 116 |
esac |
| 117 |
AC_SUBST(toolexecdir) |
| 118 |
AC_SUBST(toolexeclibdir) |
| 119 |
|
| 120 |
AC_GNU_SOURCE |
| 121 |
AC_CHECK_FUNCS([__secure_getenv]) |
| 122 |
|
| 123 |
AC_GNU_SOURCE |
| 124 |
AC_CHECK_FUNCS([secure_getenv]) |
| 125 |
|
| 126 |
AC_CHECK_FUNCS([getexecname __fortify_fail]) |
| 127 |
|
| 128 |
# Check for programs. |
| 129 |
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) |
| 130 |
m4_define([_AC_ARG_VAR_PRECIOUS],[]) |
| 131 |
AC_PROG_CC |
| 132 |
AC_PROG_CXX |
| 133 |
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
| 134 |
|
| 135 |
AM_PROG_CC_C_O |
| 136 |
|
| 137 |
AC_SUBST(CFLAGS) |
| 138 |
AC_SUBST(CXXFLAGS) |
| 139 |
|
| 140 |
# Newer automakes demand CCAS and CCASFLAGS. |
| 141 |
: ${CCAS='$(CC)'} |
| 142 |
: ${CCASFLAGS='$(CFLAGS)'} |
| 143 |
AC_SUBST(CCAS) |
| 144 |
AC_SUBST(CCASFLAGS) |
| 145 |
|
| 146 |
AC_CHECK_TOOL(AS, as) |
| 147 |
AC_CHECK_TOOL(AR, ar) |
| 148 |
AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 149 |
|
| 150 |
# Configure libtool |
| 151 |
AC_LIBTOOL_DLOPEN |
| 152 |
AM_PROG_LIBTOOL |
| 153 |
ACX_LT_HOST_FLAGS |
| 154 |
AC_SUBST(enable_shared) |
| 155 |
AC_SUBST(enable_static) |
| 156 |
AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes]) |
| 157 |
|
| 158 |
# For libtool versioning info, format is CURRENT:REVISION:AGE |
| 159 |
libtool_VERSION=1:0:0 |
| 160 |
AC_SUBST(libtool_VERSION) |
| 161 |
|
| 162 |
XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions" |
| 163 |
|
| 164 |
# Add CET specific flags if Intel CET is enabled. |
| 165 |
GCC_CET_FLAGS(CET_FLAGS) |
| 166 |
XCFLAGS="$XCFLAGS $CET_FLAGS" |
| 167 |
|
| 168 |
AC_SUBST(XCFLAGS) |
| 169 |
|
| 170 |
if test "${multilib}" = "yes"; then |
| 171 |
multilib_arg="--enable-multilib" |
| 172 |
else |
| 173 |
multilib_arg= |
| 174 |
fi |
| 175 |
|
| 176 |
AC_CONFIG_FILES([Makefile]) |
| 177 |
|
| 178 |
if test "x$VTV_SUPPORTED" = "xyes"; then |
| 179 |
AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]), |
| 180 |
[cat > vpsed$$ << \_EOF |
| 181 |
s!`test -f '$<' || echo '$(srcdir)/'`!! |
| 182 |
_EOF |
| 183 |
sed -f vpsed$$ $ac_file > tmp$$ |
| 184 |
mv tmp$$ $ac_file |
| 185 |
rm vpsed$$ |
| 186 |
echo 'MULTISUBDIR =' >> $ac_file |
| 187 |
ml_norecursion=yes |
| 188 |
. ${multi_basedir}/config-ml.in |
| 189 |
AS_UNSET([ml_norecursion]) |
| 190 |
]) |
| 191 |
fi |
| 192 |
|
| 193 |
case "$target_os" in |
| 194 |
cygwin*|mingw32*) |
| 195 |
vtv_cygmin="yes" |
| 196 |
;; |
| 197 |
*) |
| 198 |
vtv_cygmin="no" |
| 199 |
;; |
| 200 |
esac |
| 201 |
|
| 202 |
AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes) |
| 203 |
|
| 204 |
AC_CHECK_FUNCS([_obstack_begin]) |
| 205 |
AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no) |
| 206 |
|
| 207 |
# Determine what GCC version number to use in filesystem paths. |
| 208 |
GCC_BASE_VER |
| 209 |
|
| 210 |
AC_OUTPUT |