2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(package-unused, version-unused, libmpx)
10 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
11 AC_ARG_ENABLE(version-specific-runtime-libs,
12 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
14 yes) version_specific_libs=yes ;;
15 no) version_specific_libs=no ;;
16 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
18 [version_specific_libs=no])
19 AC_MSG_RESULT($version_specific_libs)
21 # Do not delete or change the following two lines. For why, see
22 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
24 target_alias=${target_alias-$host_alias}
25 AC_SUBST(target_alias)
26 GCC_LIBSTDCXX_RAW_CXX_FLAGS
29 unset LIBMPX_SUPPORTED
30 AC_MSG_CHECKING([for target support for Intel MPX runtime library])
31 echo "int i[[sizeof (void *) == 4 ? 1 : -1]] = { __x86_64__ };" > conftest.c
32 if AC_TRY_COMMAND([${CC} ${CFLAGS} -c -o conftest.o conftest.c 1>&AS_MESSAGE_LOG_FD])
38 rm -f conftest.o conftest.c
39 AC_MSG_RESULT($LIBMPX_SUPPORTED)
40 AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
42 link_libmpx="-lpthread"
44 AC_MSG_CHECKING([whether ld accepts -z bndplt])
45 echo "int main() {};" > conftest.c
46 if AC_TRY_COMMAND([${CC} ${CFLAGS} -Wl,-z,bndplt -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
49 link_mpx="$link_mpx -z bndplt"
56 AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
57 AM_ENABLE_MULTILIB(, ..)
61 AC_CHECK_FUNCS([secure_getenv])
63 # Calculate toolexeclibdir
64 # Also toolexecdir, though it's only used in toolexeclibdir
65 case ${version_specific_libs} in
67 # Need the gcc compiler version to know where to install libraries
68 # and header files if --enable-version-specific-runtime-libs option
70 toolexecdir='$(libdir)/gcc/$(target_alias)'
71 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
74 if test -n "$with_cross_host" &&
75 test x"$with_cross_host" != x"no"; then
76 # Install a library built with a cross compiler in tooldir, not libdir.
77 toolexecdir='$(exec_prefix)/$(target_alias)'
78 toolexeclibdir='$(toolexecdir)/lib'
80 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
81 toolexeclibdir='$(libdir)'
83 multi_os_directory=`$CC -print-multi-os-directory`
84 case $multi_os_directory in
85 .) ;; # Avoid trailing /.
86 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
91 AC_SUBST(toolexeclibdir)
94 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
95 m4_define([_AC_ARG_VAR_PRECIOUS],[])
98 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
104 # Newer automakes demand CCAS and CCASFLAGS.
106 : ${CCASFLAGS='$(CFLAGS)'}
110 AC_CHECK_TOOL(AS, as)
111 AC_CHECK_TOOL(AR, ar)
112 AC_CHECK_TOOL(RANLIB, ranlib, :)
114 # Check we may build wrappers library
115 echo "test: bndmov %bnd0, %bnd1" > conftest.s
116 if AC_TRY_COMMAND([$AS -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
121 echo "configure: no MPX support fo as" >&AS_MESSAGE_LOG_FD
123 rm -f conftest.o conftest.s
124 AM_CONDITIONAL(MPX_AS_SUPPORTED, [test "x$mpx_as" = "xyes"])
129 AC_SUBST(enable_shared)
130 AC_SUBST(enable_static)
132 XCFLAGS="-Wall -Wextra"
135 if test "${multilib}" = "yes"; then
136 multilib_arg="--enable-multilib"
141 AC_CONFIG_FILES([Makefile libmpx.spec])
142 AC_CONFIG_HEADERS(config.h)
143 AC_CONFIG_FILES(AC_FOREACH([DIR], [mpxrt mpxwrap], [DIR/Makefile ]),
144 [cat > vpsed$$ << \_EOF
145 s!`test -f '$<' || echo '$(srcdir)/'`!!
147 sed -f vpsed$$ $ac_file > tmp$$
150 echo 'MULTISUBDIR =' >> $ac_file
152 . ${multi_basedir}/config-ml.in
153 AS_UNSET([ml_norecursion])