]> git.ipfire.org Git - thirdparty/gcc.git/blob - libmpx/configure.ac
Makefile.def: Add libmpx.
[thirdparty/gcc.git] / libmpx / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.64])
5 AC_INIT(package-unused, version-unused, libmpx)
6
7 # -------
8 # Options
9 # -------
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 ],
13 [case "$enableval" in
14 yes) version_specific_libs=yes ;;
15 no) version_specific_libs=no ;;
16 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
17 esac],
18 [version_specific_libs=no])
19 AC_MSG_RESULT($version_specific_libs)
20
21 # Do not delete or change the following two lines. For why, see
22 # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
23 AC_CANONICAL_SYSTEM
24 target_alias=${target_alias-$host_alias}
25 AC_SUBST(target_alias)
26 GCC_LIBSTDCXX_RAW_CXX_FLAGS
27
28 # See if supported.
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])
33 then
34 LIBMPX_SUPPORTED=no
35 else
36 LIBMPX_SUPPORTED=yes
37 fi
38 rm -f conftest.o conftest.c
39 AC_MSG_RESULT($LIBMPX_SUPPORTED)
40 AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
41
42 link_libmpx="-lpthread"
43 AC_SUBST(link_libmpx)
44
45 AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
46 AM_ENABLE_MULTILIB(, ..)
47 AM_MAINTAINER_MODE
48
49 AC_GNU_SOURCE
50 AC_CHECK_FUNCS([secure_getenv])
51
52 # Calculate toolexeclibdir
53 # Also toolexecdir, though it's only used in toolexeclibdir
54 case ${version_specific_libs} in
55 yes)
56 # Need the gcc compiler version to know where to install libraries
57 # and header files if --enable-version-specific-runtime-libs option
58 # is selected.
59 toolexecdir='$(libdir)/gcc/$(target_alias)'
60 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
61 ;;
62 no)
63 if test -n "$with_cross_host" &&
64 test x"$with_cross_host" != x"no"; then
65 # Install a library built with a cross compiler in tooldir, not libdir.
66 toolexecdir='$(exec_prefix)/$(target_alias)'
67 toolexeclibdir='$(toolexecdir)/lib'
68 else
69 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
70 toolexeclibdir='$(libdir)'
71 fi
72 multi_os_directory=`$CC -print-multi-os-directory`
73 case $multi_os_directory in
74 .) ;; # Avoid trailing /.
75 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
76 esac
77 ;;
78 esac
79 AC_SUBST(toolexecdir)
80 AC_SUBST(toolexeclibdir)
81
82 # Check for programs.
83 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
84 m4_define([_AC_ARG_VAR_PRECIOUS],[])
85 AC_PROG_CC
86 AC_PROG_CXX
87 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
88
89 AM_PROG_CC_C_O
90
91 AC_SUBST(CFLAGS)
92
93 # Newer automakes demand CCAS and CCASFLAGS.
94 : ${CCAS='$(CC)'}
95 : ${CCASFLAGS='$(CFLAGS)'}
96 AC_SUBST(CCAS)
97 AC_SUBST(CCASFLAGS)
98
99 AC_CHECK_TOOL(AS, as)
100 AC_CHECK_TOOL(AR, ar)
101 AC_CHECK_TOOL(RANLIB, ranlib, :)
102
103 # Configure libtool
104 AC_LIBTOOL_DLOPEN
105 AM_PROG_LIBTOOL
106 AC_SUBST(enable_shared)
107 AC_SUBST(enable_static)
108
109 XCFLAGS="-Wall -Wextra"
110 AC_SUBST(XCFLAGS)
111
112 if test "${multilib}" = "yes"; then
113 multilib_arg="--enable-multilib"
114 else
115 multilib_arg=
116 fi
117
118 AC_CONFIG_FILES([Makefile libmpx.spec])
119 AC_CONFIG_HEADERS(config.h)
120 AC_CONFIG_FILES(AC_FOREACH([DIR], [mpxrt], [DIR/Makefile]),
121 [cat > vpsed$$ << \_EOF
122 s!`test -f '$<' || echo '$(srcdir)/'`!!
123 _EOF
124 sed -f vpsed$$ $ac_file > tmp$$
125 mv tmp$$ $ac_file
126 rm vpsed$$
127 echo 'MULTISUBDIR =' >> $ac_file
128 ml_norecursion=yes
129 . ${multi_basedir}/config-ml.in
130 AS_UNSET([ml_norecursion])
131 ])
132
133 AC_OUTPUT