comparison libmpx/configure.ac @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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
27 # See if supported.
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])
32 then
33 LIBMPX_SUPPORTED=no
34 else
35 LIBMPX_SUPPORTED=yes
36 fi
37 rm -f conftest.o conftest.c
38 AC_MSG_RESULT($LIBMPX_SUPPORTED)
39 AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
40
41 link_libmpx="-lpthread"
42 AC_SUBST(link_libmpx)
43
44 AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
45 AM_ENABLE_MULTILIB(, ..)
46 AM_MAINTAINER_MODE
47
48 AC_GNU_SOURCE
49 AC_CHECK_FUNCS([secure_getenv])
50
51 # Calculate toolexeclibdir
52 # Also toolexecdir, though it's only used in toolexeclibdir
53 case ${version_specific_libs} in
54 yes)
55 # Need the gcc compiler version to know where to install libraries
56 # and header files if --enable-version-specific-runtime-libs option
57 # is selected.
58 toolexecdir='$(libdir)/gcc/$(target_alias)'
59 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
60 ;;
61 no)
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'
67 else
68 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
69 toolexeclibdir='$(libdir)'
70 fi
71 multi_os_directory=`$CC -print-multi-os-directory`
72 case $multi_os_directory in
73 .) ;; # Avoid trailing /.
74 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
75 esac
76 ;;
77 esac
78 AC_SUBST(toolexecdir)
79 AC_SUBST(toolexeclibdir)
80
81 # Check for programs.
82 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
83 m4_define([_AC_ARG_VAR_PRECIOUS],[])
84 AC_PROG_CC
85 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
86
87 AM_PROG_CC_C_O
88
89 AC_SUBST(CFLAGS)
90
91 # Newer automakes demand CCAS and CCASFLAGS.
92 : ${CCAS='$(CC)'}
93 : ${CCASFLAGS='$(CFLAGS)'}
94 AC_SUBST(CCAS)
95 AC_SUBST(CCASFLAGS)
96
97 AC_CHECK_TOOL(AS, as)
98 AC_CHECK_TOOL(AR, ar)
99 AC_CHECK_TOOL(RANLIB, ranlib, :)
100
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])
104 then
105 mpx_as=yes
106 else
107 mpx_as=no
108 echo "configure: no MPX support fo as" >&AS_MESSAGE_LOG_FD
109 fi
110 rm -f conftest.o conftest.s
111 AM_CONDITIONAL(MPX_AS_SUPPORTED, [test "x$mpx_as" = "xyes"])
112
113 # Configure libtool
114 AC_LIBTOOL_DLOPEN
115 AM_PROG_LIBTOOL
116 AC_SUBST(enable_shared)
117 AC_SUBST(enable_static)
118
119 XCFLAGS="-Wall -Wextra"
120 AC_SUBST(XCFLAGS)
121
122 if test "${multilib}" = "yes"; then
123 multilib_arg="--enable-multilib"
124 else
125 multilib_arg=
126 fi
127
128 # Determine what GCC version number to use in filesystem paths.
129 GCC_BASE_VER
130
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)/'`!!
136 _EOF
137 sed -f vpsed$$ $ac_file > tmp$$
138 mv tmp$$ $ac_file
139 rm vpsed$$
140 echo 'MULTISUBDIR =' >> $ac_file
141 ml_norecursion=yes
142 . ${multi_basedir}/config-ml.in
143 AS_UNSET([ml_norecursion])
144 ])
145
146 AC_OUTPUT