111
|
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 AM_ENABLE_MULTILIB(, ..)
|
|
10
|
|
11 # -------
|
|
12 # Options
|
|
13 # -------
|
|
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 ],
|
|
17 [case "$enableval" in
|
|
18 yes) version_specific_libs=yes ;;
|
|
19 no) version_specific_libs=no ;;
|
|
20 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
|
21 esac],
|
|
22 [version_specific_libs=no])
|
|
23 AC_MSG_RESULT($version_specific_libs)
|
|
24
|
|
25 # Do not delete or change the following two lines. For why, see
|
|
26 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
|
|
27 AC_CANONICAL_SYSTEM
|
|
28 target_alias=${target_alias-$host_alias}
|
|
29 AC_SUBST(target_alias)
|
|
30 GCC_LIBSTDCXX_RAW_CXX_FLAGS
|
|
31
|
|
32 AC_USE_SYSTEM_EXTENSIONS
|
|
33
|
|
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 ],
|
|
38 [case "$enableval" in
|
|
39 yes) enable_vtable_verify=yes ;;
|
|
40 no) enable_vtable_verify=no ;;
|
|
41 *) enable_vtable_verify=no;;
|
|
42 esac],
|
|
43 [enable_vtable_verify=no])
|
|
44 AC_MSG_RESULT($enable_vtable_verify)
|
|
45
|
|
46 # See if supported.
|
|
47 unset VTV_SUPPORTED
|
|
48 AC_MSG_CHECKING([for host support for vtable verification])
|
|
49 . ${srcdir}/configure.tgt
|
|
50 case ${host} in
|
|
51 *-*-solaris2*)
|
|
52 # libvtv requires init priority support, which depends on the linker
|
|
53 # used on Solaris.
|
|
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
|
|
59 VTV_SUPPORTED=no
|
|
60 fi
|
|
61 # FIXME: Maybe check for dl_iterate_phdr, too? Should be covered by
|
|
62 # configure.tgt restricting to libvtv to Solaris 11+.
|
|
63 ;;
|
|
64 esac
|
|
65 AC_MSG_RESULT($VTV_SUPPORTED)
|
|
66
|
|
67 # Decide if it's usable.
|
|
68 use_vtable_verify=no
|
|
69 if test "x$VTV_SUPPORTED" = "xyes"; then
|
|
70 if test "x$enable_vtable_verify" = "xyes"; then
|
|
71 use_vtable_verify=yes
|
|
72 AC_MSG_NOTICE(using vtable verification)
|
|
73 fi
|
|
74 fi
|
|
75 AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes)
|
|
76
|
|
77 AM_INIT_AUTOMAKE(foreign no-dist)
|
|
78 AM_MAINTAINER_MODE
|
|
79
|
|
80 LIBVTV_CONFIGURE
|
|
81
|
|
82 # Calculate toolexeclibdir
|
|
83 # Also toolexecdir, though it's only used in toolexeclibdir
|
|
84 case ${version_specific_libs} in
|
|
85 yes)
|
|
86 # Need the gcc compiler version to know where to install libraries
|
|
87 # and header files if --enable-version-specific-runtime-libs option
|
|
88 # is selected.
|
|
89 toolexecdir='$(libdir)/gcc/$(target_alias)'
|
|
90 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
|
91 ;;
|
|
92 no)
|
|
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'
|
|
98 else
|
|
99 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
|
100 toolexeclibdir='$(libdir)'
|
|
101 fi
|
|
102 multi_os_directory=`$CC -print-multi-os-directory`
|
|
103 case $multi_os_directory in
|
|
104 .) ;; # Avoid trailing /.
|
|
105 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
|
106 esac
|
|
107 ;;
|
|
108 esac
|
|
109 AC_SUBST(toolexecdir)
|
|
110 AC_SUBST(toolexeclibdir)
|
|
111
|
|
112 AC_GNU_SOURCE
|
|
113 AC_CHECK_FUNCS([__secure_getenv])
|
|
114
|
|
115 AC_GNU_SOURCE
|
|
116 AC_CHECK_FUNCS([secure_getenv])
|
|
117
|
|
118 AC_CHECK_FUNCS([getexecname __fortify_fail])
|
|
119
|
|
120 # Check for programs.
|
|
121 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
|
122 m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
|
123 AC_PROG_CC
|
|
124 AC_PROG_CXX
|
|
125 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
|
126
|
|
127 AM_PROG_CC_C_O
|
|
128
|
|
129 AC_SUBST(CFLAGS)
|
|
130 AC_SUBST(CXXFLAGS)
|
|
131
|
|
132 # Newer automakes demand CCAS and CCASFLAGS.
|
|
133 : ${CCAS='$(CC)'}
|
|
134 : ${CCASFLAGS='$(CFLAGS)'}
|
|
135 AC_SUBST(CCAS)
|
|
136 AC_SUBST(CCASFLAGS)
|
|
137
|
|
138 AC_CHECK_TOOL(AS, as)
|
|
139 AC_CHECK_TOOL(AR, ar)
|
|
140 AC_CHECK_TOOL(RANLIB, ranlib, :)
|
|
141
|
|
142 # Configure libtool
|
|
143 AC_LIBTOOL_DLOPEN
|
|
144 AM_PROG_LIBTOOL
|
|
145 ACX_LT_HOST_FLAGS
|
|
146 AC_SUBST(enable_shared)
|
|
147 AC_SUBST(enable_static)
|
|
148
|
|
149 # For libtool versioning info, format is CURRENT:REVISION:AGE
|
|
150 libtool_VERSION=1:0:0
|
|
151 AC_SUBST(libtool_VERSION)
|
|
152
|
|
153 XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
|
|
154 AC_SUBST(XCFLAGS)
|
|
155
|
|
156 if test "${multilib}" = "yes"; then
|
|
157 multilib_arg="--enable-multilib"
|
|
158 else
|
|
159 multilib_arg=
|
|
160 fi
|
|
161
|
|
162 AC_CONFIG_FILES([Makefile])
|
|
163
|
|
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)/'`!!
|
|
168 _EOF
|
|
169 sed -f vpsed$$ $ac_file > tmp$$
|
|
170 mv tmp$$ $ac_file
|
|
171 rm vpsed$$
|
|
172 echo 'MULTISUBDIR =' >> $ac_file
|
|
173 ml_norecursion=yes
|
|
174 . ${multi_basedir}/config-ml.in
|
|
175 AS_UNSET([ml_norecursion])
|
|
176 ])
|
|
177 fi
|
|
178
|
|
179 case "$target_os" in
|
|
180 cygwin*|mingw32*)
|
|
181 vtv_cygmin="yes"
|
|
182 ;;
|
|
183 *)
|
|
184 vtv_cygmin="no"
|
|
185 ;;
|
|
186 esac
|
|
187
|
|
188 AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
|
|
189
|
|
190 AC_CHECK_FUNCS([_obstack_begin])
|
|
191 AM_CONDITIONAL(VTV_NO_OBSTACK, test $ac_cv_func__obstack_begin = no)
|
|
192
|
|
193 # Determine what GCC version number to use in filesystem paths.
|
|
194 GCC_BASE_VER
|
|
195
|
|
196 AC_OUTPUT
|