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 GCC_WITH_TOOLEXECLIBDIR
83 # Calculate toolexeclibdir
84 # Also toolexecdir, though it's only used in toolexeclibdir
85 case ${version_specific_libs} in
87 # Need the gcc compiler version to know where to install libraries
88 # and header files if --enable-version-specific-runtime-libs option
90 toolexecdir='$(libdir)/gcc/$(target_alias)'
91 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
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
100 toolexeclibdir='$(toolexecdir)/lib'
103 toolexeclibdir=${with_toolexeclibdir}
107 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
108 toolexeclibdir='$(libdir)'
110 multi_os_directory=`$CC -print-multi-os-directory`
111 case $multi_os_directory in
112 .) ;; # Avoid trailing /.
113 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
117 AC_SUBST(toolexecdir)
118 AC_SUBST(toolexeclibdir)
121 AC_CHECK_FUNCS([__secure_getenv])
124 AC_CHECK_FUNCS([secure_getenv])
126 AC_CHECK_FUNCS([getexecname __fortify_fail])
128 # Check for programs.
129 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
130 m4_define([_AC_ARG_VAR_PRECIOUS],[])
133 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
140 # Newer automakes demand CCAS and CCASFLAGS.
142 : ${CCASFLAGS='$(CFLAGS)'}
146 AC_CHECK_TOOL(AS, as)
147 AC_CHECK_TOOL(AR, ar)
148 AC_CHECK_TOOL(RANLIB, ranlib, :)
154 AC_SUBST(enable_shared)
155 AC_SUBST(enable_static)
156 AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes])
158 # For libtool versioning info, format is CURRENT:REVISION:AGE
159 libtool_VERSION=1:0:0
160 AC_SUBST(libtool_VERSION)
162 XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
164 # Add CET specific flags if Intel CET is enabled.
165 GCC_CET_FLAGS(CET_FLAGS)
166 XCFLAGS="$XCFLAGS $CET_FLAGS"
170 if test "${multilib}" = "yes"; then
171 multilib_arg="--enable-multilib"
176 AC_CONFIG_FILES([Makefile])
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)/'`!!
183 sed -f vpsed$$ $ac_file > tmp$$
186 echo 'MULTISUBDIR =' >> $ac_file
188 . ${multi_basedir}/config-ml.in
189 AS_UNSET([ml_norecursion])
202 AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
204 AC_CHECK_FUNCS([_obstack_begin])
205 AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no)
207 # Determine what GCC version number to use in filesystem paths.