annotate libcilkrts/configure.ac @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # Copyright (C) 2011-2016, Intel Corporation
kono
parents:
diff changeset
2 # All rights reserved.
kono
parents:
diff changeset
3 #
kono
parents:
diff changeset
4 # Redistribution and use in source and binary forms, with or without
kono
parents:
diff changeset
5 # modification, are permitted provided that the following conditions
kono
parents:
diff changeset
6 # are met:
kono
parents:
diff changeset
7 #
kono
parents:
diff changeset
8 # * Redistributions of source code must retain the above copyright
kono
parents:
diff changeset
9 # notice, this list of conditions and the following disclaimer.
kono
parents:
diff changeset
10 # * Redistributions in binary form must reproduce the above copyright
kono
parents:
diff changeset
11 # notice, this list of conditions and the following disclaimer in
kono
parents:
diff changeset
12 # the documentation and/or other materials provided with the
kono
parents:
diff changeset
13 # distribution.
kono
parents:
diff changeset
14 # * Neither the name of Intel Corporation nor the names of its
kono
parents:
diff changeset
15 # contributors may be used to endorse or promote products derived
kono
parents:
diff changeset
16 # from this software without specific prior written permission.
kono
parents:
diff changeset
17 #
kono
parents:
diff changeset
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
kono
parents:
diff changeset
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
kono
parents:
diff changeset
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
kono
parents:
diff changeset
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
kono
parents:
diff changeset
22 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
kono
parents:
diff changeset
23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
kono
parents:
diff changeset
24 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
kono
parents:
diff changeset
25 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
kono
parents:
diff changeset
26 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
kono
parents:
diff changeset
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
kono
parents:
diff changeset
28 # WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
kono
parents:
diff changeset
29 # POSSIBILITY OF SUCH DAMAGE.
kono
parents:
diff changeset
30 #
kono
parents:
diff changeset
31 # *********************************************************************
kono
parents:
diff changeset
32 #
kono
parents:
diff changeset
33 # PLEASE NOTE: This file is a downstream copy of a file mainitained in
kono
parents:
diff changeset
34 # a repository at cilkplus.org. Changes made to this file that are not
kono
parents:
diff changeset
35 # submitted through the contribution process detailed at
kono
parents:
diff changeset
36 # http://www.cilkplus.org/submit-cilk-contribution will be lost the next
kono
parents:
diff changeset
37 # time that a new version is released. Changes only submitted to the
kono
parents:
diff changeset
38 # GNU compiler collection or posted to the git repository at
kono
parents:
diff changeset
39 # https://bitbucket.org/intelcilkruntime/intel-cilk-runtime.git are
kono
parents:
diff changeset
40 # not tracked.
kono
parents:
diff changeset
41 #
kono
parents:
diff changeset
42 # We welcome your contributions to this open source project. Thank you
kono
parents:
diff changeset
43 # for your assistance in helping us improve Cilk Plus.
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 AC_INIT([Cilk Runtime Library], [2.0], [cilk@intel.com])
kono
parents:
diff changeset
46 AC_PREREQ([2.64])
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 # Needed to define ${target}. Needs to be very early to avoid annoying
kono
parents:
diff changeset
49 # warning about calling AC_ARG_PROGRAM before AC_CANONICAL_SYSTEM
kono
parents:
diff changeset
50 AC_CANONICAL_SYSTEM
kono
parents:
diff changeset
51 target_alias=${target_alias-$host_alias}
kono
parents:
diff changeset
52 AC_SUBST(target_alias)
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 AM_INIT_AUTOMAKE(foreign no-dist)
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 AM_MAINTAINER_MODE
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 AM_ENABLE_MULTILIB(, ..)
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 # Test for GNU extensions. Will define _GNU_SOURCE if they're available
kono
parents:
diff changeset
61 AC_USE_SYSTEM_EXTENSIONS
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 # Build a DLL on Windows
kono
parents:
diff changeset
64 # AC_LIBTOOL_WIN32_DLL
kono
parents:
diff changeset
65 AC_PROG_CC
kono
parents:
diff changeset
66 AC_PROG_CXX
kono
parents:
diff changeset
67 # AC_PROG_LIBTOOL
kono
parents:
diff changeset
68 # AC_CONFIG_MACRO_DIR([..])
kono
parents:
diff changeset
69 AC_CONFIG_FILES([Makefile libcilkrts.spec])
kono
parents:
diff changeset
70 AC_FUNC_ALLOCA
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 # Check for dl functions
kono
parents:
diff changeset
73 AC_CHECK_LIB(dl, dladdr,
kono
parents:
diff changeset
74 [AC_DEFINE(HAVE_DLADDR, 1, [Define if you have dladdr()])])
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 # Check whether the target supports protected visibility.
kono
parents:
diff changeset
77 save_CFLAGS="$CFLAGS"
kono
parents:
diff changeset
78 CFLAGS="$CFLAGS -Werror"
kono
parents:
diff changeset
79 AC_TRY_COMPILE([void __attribute__((visibility("protected"))) foo(void) { }],
kono
parents:
diff changeset
80 [], libcilkrts_cv_have_attribute_visibility=yes,
kono
parents:
diff changeset
81 libcilkrts_cv_have_attribute_visibility=no)
kono
parents:
diff changeset
82 CFLAGS="$save_CFLAGS"
kono
parents:
diff changeset
83 if test $libcilkrts_cv_have_attribute_visibility = yes; then
kono
parents:
diff changeset
84 AC_DEFINE(HAVE_ATTRIBUTE_VISIBILITY, 1,
kono
parents:
diff changeset
85 [Define to 1 if the target supports __attribute__((visibility(...))).])
kono
parents:
diff changeset
86 fi
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 # Get target configury.
kono
parents:
diff changeset
89 . ${srcdir}/configure.tgt
kono
parents:
diff changeset
90 if test -n "$UNSUPPORTED"; then
kono
parents:
diff changeset
91 AC_MSG_ERROR([Configuration ${target} is unsupported.])
kono
parents:
diff changeset
92 fi
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 if test "${multilib}" = "yes"; then
kono
parents:
diff changeset
95 multilib_arg="--enable-multilib"
kono
parents:
diff changeset
96 else
kono
parents:
diff changeset
97 multilib_arg=
kono
parents:
diff changeset
98 fi
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
kono
parents:
diff changeset
101 AC_ARG_ENABLE([version-specific-runtime-libs],
kono
parents:
diff changeset
102 AC_HELP_STRING([--enable-version-specific-runtime-libs],
kono
parents:
diff changeset
103 [Specify that runtime libraries should be installed in a compi
kono
parents:
diff changeset
104 ler-specific directory]),
kono
parents:
diff changeset
105 [case "$enableval" in
kono
parents:
diff changeset
106 yes) enable_version_specific_runtime_libs=yes ;;
kono
parents:
diff changeset
107 no) enable_version_specific_runtime_libs=no ;;
kono
parents:
diff changeset
108 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs
kono
parents:
diff changeset
109 ]);;
kono
parents:
diff changeset
110 esac],
kono
parents:
diff changeset
111 [enable_version_specific_runtime_libs=no])
kono
parents:
diff changeset
112 AC_MSG_RESULT($enable_version_specific_runtime_libs)
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 # Calculate toolexeclibdir
kono
parents:
diff changeset
116 # Also toolexecdir, though it's only used in toolexeclibdir
kono
parents:
diff changeset
117 case ${enable_version_specific_runtime_libs} in
kono
parents:
diff changeset
118 yes)
kono
parents:
diff changeset
119 # Need the gcc compiler version to know where to install libraries
kono
parents:
diff changeset
120 # and header files if --enable-version-specific-runtime-libs option
kono
parents:
diff changeset
121 # is selected.
kono
parents:
diff changeset
122 toolexecdir='$(libdir)/gcc/$(target_alias)'
kono
parents:
diff changeset
123 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
kono
parents:
diff changeset
124 ;;
kono
parents:
diff changeset
125 no)
kono
parents:
diff changeset
126 if test -n "$with_cross_host" &&
kono
parents:
diff changeset
127 test x"$with_cross_host" != x"no"; then
kono
parents:
diff changeset
128 # Install a library built with a cross compiler in tooldir, not libdir.
kono
parents:
diff changeset
129 toolexecdir='$(exec_prefix)/$(target_alias)'
kono
parents:
diff changeset
130 toolexeclibdir='$(toolexecdir)/lib'
kono
parents:
diff changeset
131 else
kono
parents:
diff changeset
132 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
kono
parents:
diff changeset
133 toolexeclibdir='$(libdir)'
kono
parents:
diff changeset
134 fi
kono
parents:
diff changeset
135 multi_os_directory=`$CC -print-multi-os-directory`
kono
parents:
diff changeset
136 case $multi_os_directory in
kono
parents:
diff changeset
137 .) ;; # Avoid trailing /.
kono
parents:
diff changeset
138 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
kono
parents:
diff changeset
139 esac
kono
parents:
diff changeset
140 ;;
kono
parents:
diff changeset
141 esac
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 # Set config_dir based on the target. config_dir specifies where to get
kono
parents:
diff changeset
144 # target-specific files. The generic implementation is incomplete, but
kono
parents:
diff changeset
145 # contains information on what's needed
kono
parents:
diff changeset
146 case "${target}" in
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 i?86-*-* | x86_64-*-*)
kono
parents:
diff changeset
149 config_dir="x86"
kono
parents:
diff changeset
150 ;;
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 arm-*-*)
kono
parents:
diff changeset
153 config_dir="arm"
kono
parents:
diff changeset
154 ;;
kono
parents:
diff changeset
155
kono
parents:
diff changeset
156 sparc*-*-*)
kono
parents:
diff changeset
157 config_dir="sparc"
kono
parents:
diff changeset
158 ;;
kono
parents:
diff changeset
159
kono
parents:
diff changeset
160 *)
kono
parents:
diff changeset
161 config_dir="generic"
kono
parents:
diff changeset
162 ;;
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 esac
kono
parents:
diff changeset
165 AC_SUBST(config_dir)
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 # We have linker scripts for appropriate operating systems
kono
parents:
diff changeset
168 linux_linker_script=no
kono
parents:
diff changeset
169 case "${host}" in
kono
parents:
diff changeset
170 *-*-linux*)
kono
parents:
diff changeset
171 linux_linker_script=yes
kono
parents:
diff changeset
172 ;;
kono
parents:
diff changeset
173 esac
kono
parents:
diff changeset
174 AM_CONDITIONAL(LINUX_LINKER_SCRIPT, test "$linux_linker_script" = "yes")
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 mac_linker_script=no
kono
parents:
diff changeset
177 case "${host}" in
kono
parents:
diff changeset
178 *-*-apple*)
kono
parents:
diff changeset
179 mac_linker_script=yes
kono
parents:
diff changeset
180 ;;
kono
parents:
diff changeset
181 esac
kono
parents:
diff changeset
182 AM_CONDITIONAL(MAC_LINKER_SCRIPT, test "$mac_linker_script" = "yes")
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 AC_LIBTOOL_DLOPEN
kono
parents:
diff changeset
185 AM_PROG_LIBTOOL
kono
parents:
diff changeset
186 AC_SUBST(toolexecdir)
kono
parents:
diff changeset
187 AC_SUBST(toolexeclibdir)
kono
parents:
diff changeset
188
kono
parents:
diff changeset
189 AC_SUBST(lt_cv_dlopen_libs)
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 # Check to see if -pthread or -lpthread is needed. Prefer the former.
kono
parents:
diff changeset
192 # Note that the CILK_SELF_SPEC in gcc.c may force -pthread.
kono
parents:
diff changeset
193 # In case the pthread.h system header is not found, this test will fail.
kono
parents:
diff changeset
194 XCFLAGS=""
kono
parents:
diff changeset
195 XLDFLAGS=""
kono
parents:
diff changeset
196 CFLAGS="$CFLAGS -pthread"
kono
parents:
diff changeset
197 AC_LINK_IFELSE(
kono
parents:
diff changeset
198 [AC_LANG_PROGRAM(
kono
parents:
diff changeset
199 [#include <pthread.h>
kono
parents:
diff changeset
200 void *g(void *d) { return NULL; }],
kono
parents:
diff changeset
201 [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
kono
parents:
diff changeset
202 [XCFLAGS=" -Wc,-pthread"],
kono
parents:
diff changeset
203 [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
kono
parents:
diff changeset
204 AC_LINK_IFELSE(
kono
parents:
diff changeset
205 [AC_LANG_PROGRAM(
kono
parents:
diff changeset
206 [#include <pthread.h>
kono
parents:
diff changeset
207 void *g(void *d) { return NULL; }],
kono
parents:
diff changeset
208 [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
kono
parents:
diff changeset
209 [],
kono
parents:
diff changeset
210 [AC_MSG_ERROR([Pthreads are required to build libcilkrts])])])
kono
parents:
diff changeset
211
kono
parents:
diff changeset
212 # Check for pthread_{,attr_}[sg]etaffinity_np.
kono
parents:
diff changeset
213 AC_LINK_IFELSE(
kono
parents:
diff changeset
214 [AC_LANG_PROGRAM(
kono
parents:
diff changeset
215 [#include <pthread.h>],
kono
parents:
diff changeset
216 [cpu_set_t cpuset;
kono
parents:
diff changeset
217 pthread_attr_t attr;
kono
parents:
diff changeset
218 pthread_getaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset);
kono
parents:
diff changeset
219 if (CPU_ISSET (0, &cpuset))
kono
parents:
diff changeset
220 CPU_SET (1, &cpuset);
kono
parents:
diff changeset
221 else
kono
parents:
diff changeset
222 CPU_ZERO (&cpuset);
kono
parents:
diff changeset
223 pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset);
kono
parents:
diff changeset
224 pthread_attr_init (&attr);
kono
parents:
diff changeset
225 pthread_attr_getaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);
kono
parents:
diff changeset
226 pthread_attr_setaffinity_np (&attr, sizeof (cpu_set_t), &cpuset);])],
kono
parents:
diff changeset
227 AC_DEFINE(HAVE_PTHREAD_AFFINITY_NP, 1,
kono
parents:
diff changeset
228 [ Define if pthread_{,attr_}{g,s}etaffinity_np is supported.]))
kono
parents:
diff changeset
229
kono
parents:
diff changeset
230 # Every c++ lib is linking by default with -nostdlib, which leads to the
kono
parents:
diff changeset
231 # fact, that proper pthread library will not be given at link time. We have
kono
parents:
diff changeset
232 # to hard-code that.
kono
parents:
diff changeset
233 case "${target}" in
kono
parents:
diff changeset
234
kono
parents:
diff changeset
235 *android*)
kono
parents:
diff changeset
236 XLDFLAGS="$XLDFLAGS -lc"
kono
parents:
diff changeset
237 ;;
kono
parents:
diff changeset
238 *)
kono
parents:
diff changeset
239 XLDFLAGS="$XLDFLAGS -lpthread"
kono
parents:
diff changeset
240 ;;
kono
parents:
diff changeset
241
kono
parents:
diff changeset
242 esac
kono
parents:
diff changeset
243
kono
parents:
diff changeset
244 AC_SUBST(XCFLAGS)
kono
parents:
diff changeset
245 AC_SUBST(XLDFLAGS)
kono
parents:
diff changeset
246
kono
parents:
diff changeset
247 CFLAGS="$save_CFLAGS"
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 if test $enable_shared = yes; then
kono
parents:
diff changeset
250 link_cilkrts="-lcilkrts %{static: $LIBS}"
kono
parents:
diff changeset
251 else
kono
parents:
diff changeset
252 link_cilkrts="-lcilkrts $LIBS"
kono
parents:
diff changeset
253 fi
kono
parents:
diff changeset
254 AC_SUBST(link_cilkrts)
kono
parents:
diff changeset
255
kono
parents:
diff changeset
256 # Determine what GCC version number to use in filesystem paths.
kono
parents:
diff changeset
257 GCC_BASE_VER
kono
parents:
diff changeset
258
kono
parents:
diff changeset
259 # Must be last
kono
parents:
diff changeset
260 AC_OUTPUT