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"
44 AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
45 AM_ENABLE_MULTILIB(, ..)
49 AC_CHECK_FUNCS([secure_getenv])
51 # Calculate toolexeclibdir
52 # Also toolexecdir, though it's only used in toolexeclibdir
53 case ${version_specific_libs} in
55 # Need the gcc compiler version to know where to install libraries
56 # and header files if --enable-version-specific-runtime-libs option
58 toolexecdir='$(libdir)/gcc/$(target_alias)'
59 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
62 if test -n "$with_cross_host" &&
63 test x"$with_cross_host" != x"no"; then
64 # Install a library built with a cross compiler in tooldir, not libdir.
65 toolexecdir='$(exec_prefix)/$(target_alias)'
66 toolexeclibdir='$(toolexecdir)/lib'
68 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
69 toolexeclibdir='$(libdir)'
71 multi_os_directory=`$CC -print-multi-os-directory`
72 case $multi_os_directory in
73 .) ;; # Avoid trailing /.
74 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
79 AC_SUBST(toolexeclibdir)
82 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
83 m4_define([_AC_ARG_VAR_PRECIOUS],[])
85 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
91 # Newer automakes demand CCAS and CCASFLAGS.
93 : ${CCASFLAGS='$(CFLAGS)'}
99 AC_CHECK_TOOL(RANLIB, ranlib, :)
101 # Check we may build wrappers library
102 echo "test: bndmov %bnd0, %bnd1" > conftest.s
103 if AC_TRY_COMMAND([$AS -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
108 echo "configure: no MPX support fo as" >&AS_MESSAGE_LOG_FD
110 rm -f conftest.o conftest.s
111 AM_CONDITIONAL(MPX_AS_SUPPORTED, [test "x$mpx_as" = "xyes"])
116 AC_SUBST(enable_shared)
117 AC_SUBST(enable_static)
119 XCFLAGS="-Wall -Wextra"
122 if test "${multilib}" = "yes"; then
123 multilib_arg="--enable-multilib"
128 # Determine what GCC version number to use in filesystem paths.
131 AC_CONFIG_FILES([Makefile libmpx.spec])
132 AC_CONFIG_HEADERS(config.h)
133 AC_CONFIG_FILES(AC_FOREACH([DIR], [mpxrt mpxwrap], [DIR/Makefile ]),
134 [cat > vpsed$$ << \_EOF
135 s!`test -f '$<' || echo '$(srcdir)/'`!!
137 sed -f vpsed$$ $ac_file > tmp$$
140 echo 'MULTISUBDIR =' >> $ac_file
142 . ${multi_basedir}/config-ml.in
143 AS_UNSET([ml_norecursion])