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)
28 unset LIBMPX_SUPPORTED
29 AC_MSG_CHECKING([for target support for Intel MPX runtime library])
30 echo "int i[[sizeof (void *) == 4 ? 1 : -1]] = { __x86_64__ };" > conftest.c
31 if AC_TRY_COMMAND([${CC} ${CFLAGS} -c -o conftest.o conftest.c 1>&AS_MESSAGE_LOG_FD])
37 rm -f conftest.o conftest.c
38 AC_MSG_RESULT($LIBMPX_SUPPORTED)
39 AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
41 link_libmpx="-lpthread"
43 AC_MSG_CHECKING([whether ld accepts -z bndplt])
44 echo "int main() {};" > conftest.c
45 if AC_TRY_COMMAND([${CC} ${CFLAGS} -Wl,-z,bndplt -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
48 link_mpx="$link_mpx -z bndplt"
55 AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
56 AM_ENABLE_MULTILIB(, ..)
60 AC_CHECK_FUNCS([secure_getenv])
62 # Calculate toolexeclibdir
63 # Also toolexecdir, though it's only used in toolexeclibdir
64 case ${version_specific_libs} in
66 # Need the gcc compiler version to know where to install libraries
67 # and header files if --enable-version-specific-runtime-libs option
69 toolexecdir='$(libdir)/gcc/$(target_alias)'
70 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
73 if test -n "$with_cross_host" &&
74 test x"$with_cross_host" != x"no"; then
75 # Install a library built with a cross compiler in tooldir, not libdir.
76 toolexecdir='$(exec_prefix)/$(target_alias)'
77 toolexeclibdir='$(toolexecdir)/lib'
79 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
80 toolexeclibdir='$(libdir)'
82 multi_os_directory=`$CC -print-multi-os-directory`
83 case $multi_os_directory in
84 .) ;; # Avoid trailing /.
85 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
90 AC_SUBST(toolexeclibdir)
93 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
94 m4_define([_AC_ARG_VAR_PRECIOUS],[])
96 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
102 # Newer automakes demand CCAS and CCASFLAGS.
104 : ${CCASFLAGS='$(CFLAGS)'}
108 AC_CHECK_TOOL(AS, as)
109 AC_CHECK_TOOL(AR, ar)
110 AC_CHECK_TOOL(RANLIB, ranlib, :)
112 # Check we may build wrappers library
113 echo "test: bndmov %bnd0, %bnd1" > conftest.s
114 if AC_TRY_COMMAND([$AS -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
119 echo "configure: no MPX support fo as" >&AS_MESSAGE_LOG_FD
121 rm -f conftest.o conftest.s
122 AM_CONDITIONAL(MPX_AS_SUPPORTED, [test "x$mpx_as" = "xyes"])
127 AC_SUBST(enable_shared)
128 AC_SUBST(enable_static)
130 XCFLAGS="-Wall -Wextra"
133 if test "${multilib}" = "yes"; then
134 multilib_arg="--enable-multilib"
139 AC_CONFIG_FILES([Makefile libmpx.spec])
140 AC_CONFIG_HEADERS(config.h)
141 AC_CONFIG_FILES(AC_FOREACH([DIR], [mpxrt mpxwrap], [DIR/Makefile ]),
142 [cat > vpsed$$ << \_EOF
143 s!`test -f '$<' || echo '$(srcdir)/'`!!
145 sed -f vpsed$$ $ac_file > tmp$$
148 echo 'MULTISUBDIR =' >> $ac_file
150 . ${multi_basedir}/config-ml.in
151 AS_UNSET([ml_norecursion])