2 # Process this file with autoconf to produce a configure script.
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])
8 AM_ENABLE_MULTILIB(, ..)
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 ],
17 yes) version_specific_libs=yes ;;
18 no) version_specific_libs=no ;;
19 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
21 [version_specific_libs=no])
22 AC_MSG_RESULT($version_specific_libs)
24 # Do not delete or change the following two lines. For why, see
25 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
27 target_alias=${target_alias-$host_alias}
28 AC_SUBST(target_alias)
29 GCC_LIBSTDCXX_RAW_CXX_FLAGS
31 AC_USE_SYSTEM_EXTENSIONS
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 ],
38 yes) enable_vtable_verify=yes ;;
39 no) enable_vtable_verify=no ;;
40 *) enable_vtable_verify=no;;
42 [enable_vtable_verify=no])
43 AC_MSG_RESULT($enable_vtable_verify)
47 AC_MSG_CHECKING([for host support for vtable verification])
48 . ${srcdir}/configure.tgt
51 # libvtv requires init priority support, which depends on the linker
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
60 # FIXME: Maybe check for dl_iterate_phdr, too? Should be covered by
61 # configure.tgt restricting to libvtv to Solaris 11+.
64 AC_MSG_RESULT($VTV_SUPPORTED)
66 # Decide if it's usable.
68 if test "x$VTV_SUPPORTED" = "xyes"; then
69 if test "x$enable_vtable_verify" = "xyes"; then
71 AC_MSG_NOTICE(using vtable verification)
74 AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes)
76 AM_INIT_AUTOMAKE(foreign no-dist)
81 # Calculate toolexeclibdir
82 # Also toolexecdir, though it's only used in toolexeclibdir
83 case ${version_specific_libs} in
85 # Need the gcc compiler version to know where to install libraries
86 # and header files if --enable-version-specific-runtime-libs option
88 toolexecdir='$(libdir)/gcc/$(target_alias)'
89 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
92 if test -n "$with_cross_host" &&
93 test x"$with_cross_host" != x"no"; then
94 # Install a library built with a cross compiler in tooldir, not libdir.
95 toolexecdir='$(exec_prefix)/$(target_alias)'
96 toolexeclibdir='$(toolexecdir)/lib'
98 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
99 toolexeclibdir='$(libdir)'
101 multi_os_directory=`$CC -print-multi-os-directory`
102 case $multi_os_directory in
103 .) ;; # Avoid trailing /.
104 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
108 AC_SUBST(toolexecdir)
109 AC_SUBST(toolexeclibdir)
112 AC_CHECK_FUNCS([__secure_getenv])
115 AC_CHECK_FUNCS([secure_getenv])
117 AC_CHECK_FUNCS([getexecname __fortify_fail])
119 # Check for programs.
120 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
121 m4_define([_AC_ARG_VAR_PRECIOUS],[])
124 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
131 # Newer automakes demand CCAS and CCASFLAGS.
133 : ${CCASFLAGS='$(CFLAGS)'}
137 AC_CHECK_TOOL(AS, as)
138 AC_CHECK_TOOL(AR, ar)
139 AC_CHECK_TOOL(RANLIB, ranlib, :)
145 AC_SUBST(enable_shared)
146 AC_SUBST(enable_static)
148 # For libtool versioning info, format is CURRENT:REVISION:AGE
149 libtool_VERSION=1:0:0
150 AC_SUBST(libtool_VERSION)
152 XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
154 # Add CET specific flags if Intel CET is enabled.
155 GCC_CET_FLAGS(CET_FLAGS)
156 XCFLAGS="$XCFLAGS $CET_FLAGS"
160 if test "${multilib}" = "yes"; then
161 multilib_arg="--enable-multilib"
166 AC_CONFIG_FILES([Makefile])
168 if test "x$VTV_SUPPORTED" = "xyes"; then
169 AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]),
170 [cat > vpsed$$ << \_EOF
171 s!`test -f '$<' || echo '$(srcdir)/'`!!
173 sed -f vpsed$$ $ac_file > tmp$$
176 echo 'MULTISUBDIR =' >> $ac_file
178 . ${multi_basedir}/config-ml.in
179 AS_UNSET([ml_norecursion])
192 AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
194 AC_CHECK_FUNCS([_obstack_begin])
195 AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no)
197 # Determine what GCC version number to use in filesystem paths.