]>
Commit | Line | Data |
---|---|---|
2077db1b CT |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
4 | AC_PREREQ([2.64]) | |
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]) | |
8 | ||
9 | # ------- | |
10 | # Options | |
11 | # ------- | |
12 | AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) | |
13 | AC_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]) | |
21 | AC_MSG_RESULT($version_specific_libs) | |
22 | ||
f5ebad64 L |
23 | # Do not delete or change the following two lines. For why, see |
24 | # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html | |
25 | AC_CANONICAL_SYSTEM | |
26 | target_alias=${target_alias-$host_alias} | |
27 | AC_SUBST(target_alias) | |
28 | GCC_LIBSTDCXX_RAW_CXX_FLAGS | |
29 | ||
56fc7835 CT |
30 | # Use same top-level configure hooks in libgcc/libstdc++/libvtv. |
31 | AC_MSG_CHECKING([for --enable-vtable-verify]) | |
32 | AC_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]) | |
40 | AC_MSG_RESULT($enable_vtable_verify) | |
41 | ||
0c6cb2d1 BK |
42 | # See if supported. |
43 | unset VTV_SUPPORTED | |
44 | AC_MSG_CHECKING([for host support for vtable verification]) | |
45 | . ${srcdir}/configure.tgt | |
46 | AC_MSG_RESULT($VTV_SUPPORTED) | |
47 | ||
48 | # Decide if it's usable. | |
49 | use_vtable_verify=no | |
50 | if test "x$VTV_SUPPORTED" = "xyes"; then | |
56fc7835 CT |
51 | if test "x$enable_vtable_verify" = "xyes"; then |
52 | use_vtable_verify=yes | |
53 | AC_MSG_NOTICE(using vtable verification) | |
54 | fi | |
0c6cb2d1 | 55 | fi |
56fc7835 | 56 | AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes) |
0c6cb2d1 | 57 | |
2077db1b CT |
58 | AM_INIT_AUTOMAKE(foreign no-dist) |
59 | AM_ENABLE_MULTILIB(, ..) | |
60 | AM_MAINTAINER_MODE | |
61 | ||
0c6cb2d1 BK |
62 | LIBVTV_CONFIGURE |
63 | ||
2077db1b CT |
64 | # Calculate toolexeclibdir |
65 | # Also toolexecdir, though it's only used in toolexeclibdir | |
66 | case ${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 | ;; | |
90 | esac | |
91 | AC_SUBST(toolexecdir) | |
92 | AC_SUBST(toolexeclibdir) | |
93 | ||
8bc16536 CT |
94 | AC_GNU_SOURCE |
95 | AC_CHECK_FUNCS([__secure_getenv]) | |
96 | ||
97 | AC_GNU_SOURCE | |
98 | AC_CHECK_FUNCS([secure_getenv]) | |
99 | ||
2077db1b CT |
100 | # Check for programs. |
101 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
102 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
103 | AC_PROG_CC | |
104 | AC_PROG_CXX | |
105 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) | |
106 | ||
107 | AM_PROG_CC_C_O | |
108 | ||
109 | AC_SUBST(CFLAGS) | |
110 | AC_SUBST(CXXFLAGS) | |
111 | ||
112 | # Newer automakes demand CCAS and CCASFLAGS. | |
113 | : ${CCAS='$(CC)'} | |
114 | : ${CCASFLAGS='$(CFLAGS)'} | |
115 | AC_SUBST(CCAS) | |
116 | AC_SUBST(CCASFLAGS) | |
117 | ||
118 | AC_CHECK_TOOL(AS, as) | |
119 | AC_CHECK_TOOL(AR, ar) | |
120 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
121 | ||
122 | # Configure libtool | |
123 | AC_LIBTOOL_DLOPEN | |
124 | AM_PROG_LIBTOOL | |
125 | AC_SUBST(enable_shared) | |
126 | AC_SUBST(enable_static) | |
127 | ||
128 | # For libtool versioning info, format is CURRENT:REVISION:AGE | |
129 | libtool_VERSION=1:0:0 | |
130 | AC_SUBST(libtool_VERSION) | |
131 | ||
132 | XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions" | |
133 | AC_SUBST(XCFLAGS) | |
134 | ||
135 | if test "${multilib}" = "yes"; then | |
136 | multilib_arg="--enable-multilib" | |
137 | else | |
138 | multilib_arg= | |
139 | fi | |
140 | ||
2077db1b CT |
141 | AC_CONFIG_FILES([Makefile]) |
142 | ||
143 | if test "x$VTV_SUPPORTED" = "xyes"; then | |
56fc7835 | 144 | AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]), |
2077db1b CT |
145 | [cat > vpsed$$ << \_EOF |
146 | s!`test -f '$<' || echo '$(srcdir)/'`!! | |
147 | _EOF | |
148 | sed -f vpsed$$ $ac_file > tmp$$ | |
149 | mv tmp$$ $ac_file | |
150 | rm vpsed$$ | |
151 | echo 'MULTISUBDIR =' >> $ac_file | |
152 | ml_norecursion=yes | |
153 | . ${multi_basedir}/config-ml.in | |
154 | AS_UNSET([ml_norecursion]) | |
155 | ]) | |
156 | fi | |
157 | ||
158 | AC_OUTPUT |