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])
9 AM_ENABLE_MULTILIB(, ..)
14 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
15 AC_ARG_ENABLE(version-specific-runtime-libs,
16 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
18 yes) version_specific_libs=yes ;;
19 no) version_specific_libs=no ;;
20 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
22 [version_specific_libs=no])
23 AC_MSG_RESULT($version_specific_libs)
25 # Do not delete or change the following two lines. For why, see
26 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
28 target_alias=${target_alias-$host_alias}
29 AC_SUBST(target_alias)
30 GCC_LIBSTDCXX_RAW_CXX_FLAGS
32 AC_USE_SYSTEM_EXTENSIONS
34 # Use same top-level configure hooks in libgcc/libstdc++/libvtv.
35 AC_MSG_CHECKING([for --enable-vtable-verify])
36 AC_ARG_ENABLE(vtable-verify,
37 [ --enable-vtable-verify Enable vtable verification feature ],
39 yes) enable_vtable_verify=yes ;;
40 no) enable_vtable_verify=no ;;
41 *) enable_vtable_verify=no;;
43 [enable_vtable_verify=no])
44 AC_MSG_RESULT($enable_vtable_verify)
48 AC_MSG_CHECKING([for host support for vtable verification])
49 . ${srcdir}/configure.tgt
52 # libvtv requires init priority support, which depends on the linker
54 AC_CACHE_CHECK(for init priority support, libvtv_cv_init_priority, [
55 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
56 [[void ip (void) __attribute__ ((constructor (1)));]])],
57 [libgcc_cv_init_priority=yes],[libgcc_cv_init_priority=no])])
58 if test x$libvtv_cv_init_priority = xno; then
61 # FIXME: Maybe check for dl_iterate_phdr, too? Should be covered by
62 # configure.tgt restricting to libvtv to Solaris 11+.
65 AC_MSG_RESULT($VTV_SUPPORTED)
67 # Decide if it's usable.
69 if test "x$VTV_SUPPORTED" = "xyes"; then
70 if test "x$enable_vtable_verify" = "xyes"; then
72 AC_MSG_NOTICE(using vtable verification)
75 AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes)
77 AM_INIT_AUTOMAKE(foreign no-dist)
82 # Calculate toolexeclibdir
83 # Also toolexecdir, though it's only used in toolexeclibdir
84 case ${version_specific_libs} in
86 # Need the gcc compiler version to know where to install libraries
87 # and header files if --enable-version-specific-runtime-libs option
89 toolexecdir='$(libdir)/gcc/$(target_alias)'
90 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
93 if test -n "$with_cross_host" &&
94 test x"$with_cross_host" != x"no"; then
95 # Install a library built with a cross compiler in tooldir, not libdir.
96 toolexecdir='$(exec_prefix)/$(target_alias)'
97 toolexeclibdir='$(toolexecdir)/lib'
99 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
100 toolexeclibdir='$(libdir)'
102 multi_os_directory=`$CC -print-multi-os-directory`
103 case $multi_os_directory in
104 .) ;; # Avoid trailing /.
105 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
109 AC_SUBST(toolexecdir)
110 AC_SUBST(toolexeclibdir)
113 AC_CHECK_FUNCS([__secure_getenv])
116 AC_CHECK_FUNCS([secure_getenv])
118 AC_CHECK_FUNCS([getexecname __fortify_fail])
120 # Check for programs.
121 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
122 m4_define([_AC_ARG_VAR_PRECIOUS],[])
125 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
132 # Newer automakes demand CCAS and CCASFLAGS.
134 : ${CCASFLAGS='$(CFLAGS)'}
138 AC_CHECK_TOOL(AS, as)
139 AC_CHECK_TOOL(AR, ar)
140 AC_CHECK_TOOL(RANLIB, ranlib, :)
146 AC_SUBST(enable_shared)
147 AC_SUBST(enable_static)
149 # For libtool versioning info, format is CURRENT:REVISION:AGE
150 libtool_VERSION=1:0:0
151 AC_SUBST(libtool_VERSION)
153 XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
156 if test "${multilib}" = "yes"; then
157 multilib_arg="--enable-multilib"
162 AC_CONFIG_FILES([Makefile])
164 if test "x$VTV_SUPPORTED" = "xyes"; then
165 AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]),
166 [cat > vpsed$$ << \_EOF
167 s!`test -f '$<' || echo '$(srcdir)/'`!!
169 sed -f vpsed$$ $ac_file > tmp$$
172 echo 'MULTISUBDIR =' >> $ac_file
174 . ${multi_basedir}/config-ml.in
175 AS_UNSET([ml_norecursion])
188 AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
190 AC_CHECK_FUNCS([_obstack_begin])
191 AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no)
193 # Determine what GCC version number to use in filesystem paths.