]>
Commit | Line | Data |
---|---|---|
2077db1b CT |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
3 | ||
2077db1b CT |
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 | ||
701fa326 MK |
8 | AM_ENABLE_MULTILIB(, ..) |
9 | ||
2077db1b CT |
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 | ||
f5ebad64 L |
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 | ||
e5ef217c RO |
31 | AC_USE_SYSTEM_EXTENSIONS |
32 | ||
56fc7835 CT |
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 | ||
0c6cb2d1 BK |
45 | # See if supported. |
46 | unset VTV_SUPPORTED | |
47 | AC_MSG_CHECKING([for host support for vtable verification]) | |
48 | . ${srcdir}/configure.tgt | |
e5ef217c RO |
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 | |
0c6cb2d1 BK |
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 | |
56fc7835 CT |
69 | if test "x$enable_vtable_verify" = "xyes"; then |
70 | use_vtable_verify=yes | |
71 | AC_MSG_NOTICE(using vtable verification) | |
72 | fi | |
0c6cb2d1 | 73 | fi |
56fc7835 | 74 | AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes) |
0c6cb2d1 | 75 | |
2077db1b | 76 | AM_INIT_AUTOMAKE(foreign no-dist) |
2077db1b CT |
77 | AM_MAINTAINER_MODE |
78 | ||
0c6cb2d1 BK |
79 | LIBVTV_CONFIGURE |
80 | ||
2077db1b CT |
81 | # Calculate toolexeclibdir |
82 | # Also toolexecdir, though it's only used in toolexeclibdir | |
83 | case ${version_specific_libs} in | |
84 | yes) | |
85 | # Need the gcc compiler version to know where to install libraries | |
86 | # and header files if --enable-version-specific-runtime-libs option | |
87 | # is selected. | |
88 | toolexecdir='$(libdir)/gcc/$(target_alias)' | |
89 | toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' | |
90 | ;; | |
91 | no) | |
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' | |
97 | else | |
98 | toolexecdir='$(libdir)/gcc-lib/$(target_alias)' | |
99 | toolexeclibdir='$(libdir)' | |
100 | fi | |
101 | multi_os_directory=`$CC -print-multi-os-directory` | |
102 | case $multi_os_directory in | |
103 | .) ;; # Avoid trailing /. | |
104 | *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; | |
105 | esac | |
106 | ;; | |
107 | esac | |
108 | AC_SUBST(toolexecdir) | |
109 | AC_SUBST(toolexeclibdir) | |
110 | ||
8bc16536 CT |
111 | AC_GNU_SOURCE |
112 | AC_CHECK_FUNCS([__secure_getenv]) | |
113 | ||
114 | AC_GNU_SOURCE | |
115 | AC_CHECK_FUNCS([secure_getenv]) | |
116 | ||
e5ef217c RO |
117 | AC_CHECK_FUNCS([getexecname __fortify_fail]) |
118 | ||
2077db1b CT |
119 | # Check for programs. |
120 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
121 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
122 | AC_PROG_CC | |
123 | AC_PROG_CXX | |
124 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) | |
125 | ||
126 | AM_PROG_CC_C_O | |
127 | ||
128 | AC_SUBST(CFLAGS) | |
129 | AC_SUBST(CXXFLAGS) | |
130 | ||
131 | # Newer automakes demand CCAS and CCASFLAGS. | |
132 | : ${CCAS='$(CC)'} | |
133 | : ${CCASFLAGS='$(CFLAGS)'} | |
134 | AC_SUBST(CCAS) | |
135 | AC_SUBST(CCASFLAGS) | |
136 | ||
137 | AC_CHECK_TOOL(AS, as) | |
138 | AC_CHECK_TOOL(AR, ar) | |
139 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
140 | ||
141 | # Configure libtool | |
142 | AC_LIBTOOL_DLOPEN | |
143 | AM_PROG_LIBTOOL | |
f7f049fa | 144 | ACX_LT_HOST_FLAGS |
2077db1b CT |
145 | AC_SUBST(enable_shared) |
146 | AC_SUBST(enable_static) | |
147 | ||
148 | # For libtool versioning info, format is CURRENT:REVISION:AGE | |
149 | libtool_VERSION=1:0:0 | |
150 | AC_SUBST(libtool_VERSION) | |
151 | ||
152 | XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions" | |
8e2fc055 IT |
153 | |
154 | # Add CET specific flags if Intel CET is enabled. | |
155 | GCC_CET_FLAGS(CET_FLAGS) | |
156 | XCFLAGS="$XCFLAGS $CET_FLAGS" | |
157 | ||
2077db1b CT |
158 | AC_SUBST(XCFLAGS) |
159 | ||
160 | if test "${multilib}" = "yes"; then | |
161 | multilib_arg="--enable-multilib" | |
162 | else | |
163 | multilib_arg= | |
164 | fi | |
165 | ||
2077db1b CT |
166 | AC_CONFIG_FILES([Makefile]) |
167 | ||
168 | if test "x$VTV_SUPPORTED" = "xyes"; then | |
56fc7835 | 169 | AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]), |
2077db1b CT |
170 | [cat > vpsed$$ << \_EOF |
171 | s!`test -f '$<' || echo '$(srcdir)/'`!! | |
172 | _EOF | |
173 | sed -f vpsed$$ $ac_file > tmp$$ | |
174 | mv tmp$$ $ac_file | |
175 | rm vpsed$$ | |
176 | echo 'MULTISUBDIR =' >> $ac_file | |
177 | ml_norecursion=yes | |
178 | . ${multi_basedir}/config-ml.in | |
179 | AS_UNSET([ml_norecursion]) | |
180 | ]) | |
181 | fi | |
182 | ||
f7f049fa CT |
183 | case "$target_os" in |
184 | cygwin*|mingw32*) | |
185 | vtv_cygmin="yes" | |
186 | ;; | |
187 | *) | |
188 | vtv_cygmin="no" | |
189 | ;; | |
190 | esac | |
191 | ||
192 | AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes) | |
193 | ||
e5ef217c RO |
194 | AC_CHECK_FUNCS([_obstack_begin]) |
195 | AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no) | |
196 | ||
3c36aa6b JJ |
197 | # Determine what GCC version number to use in filesystem paths. |
198 | GCC_BASE_VER | |
199 | ||
2077db1b | 200 | AC_OUTPUT |