Fix for bug Bootstrap/58918.
[official-gcc.git] / libcilkrts / configure.ac
blobf84cc2ae9cefa2bc78fa14ea00b4c889e5137690
1 #  @copyright
2 #  Copyright (C) 2011-2013, Intel Corporation
3 #  All rights reserved.
4 #  
5 #  @copyright
6 #  Redistribution and use in source and binary forms, with or without
7 #  modification, are permitted provided that the following conditions
8 #  are met:
9 #  
10 #    * Redistributions of source code must retain the above copyright
11 #      notice, this list of conditions and the following disclaimer.
12 #    * Redistributions in binary form must reproduce the above copyright
13 #      notice, this list of conditions and the following disclaimer in
14 #      the documentation and/or other materials provided with the
15 #      distribution.
16 #    * Neither the name of Intel Corporation nor the names of its
17 #      contributors may be used to endorse or promote products derived
18 #      from this software without specific prior written permission.
19 #  
20 #  @copyright
21 #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 #  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 #  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 #  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 #  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 #  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 #  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 #  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
31 #  WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 #  POSSIBILITY OF SUCH DAMAGE.
34 AC_INIT([Cilk Runtime Library], [2.0], [cilk@intel.com])
35 AC_PREREQ([2.64])
37 # Needed to define ${target}.  Needs to be very early to avoid annoying
38 # warning about calling AC_ARG_PROGRAM before AC_CANONICAL_SYSTEM
39 AC_CANONICAL_SYSTEM
40 AM_INIT_AUTOMAKE(foreign no-dist)
42 AM_MAINTAINER_MODE
44 # Build a DLL on Windows
45 # AC_LIBTOOL_WIN32_DLL
46 AC_PROG_CXX
47 AC_PROG_CC
48 # AC_PROG_LIBTOOL
49 # AC_CONFIG_MACRO_DIR([..])
50 AC_CONFIG_FILES([Makefile])
51 AM_ENABLE_MULTILIB(, ..)
52 AC_FUNC_ALLOCA
54 # Get target configury.
55 . ${srcdir}/configure.tgt
56 if test -n "$UNSUPPORTED"; then
57    AC_MSG_ERROR([Configuration ${target} is unsupported.])
60 if test "${multilib}" = "yes"; then
61   multilib_arg="--enable-multilib"
62 else
63   multilib_arg=
66 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
67 AC_ARG_ENABLE([version-specific-runtime-libs],
68   AC_HELP_STRING([--enable-version-specific-runtime-libs],
69                  [Specify that runtime libraries should be installed in a compi
70 ler-specific directory]),
71   [case "$enableval" in
72     yes) enable_version_specific_runtime_libs=yes ;;
73     no)  enable_version_specific_runtime_libs=no ;;
74     *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs
75 ]);;
76    esac],
77   [enable_version_specific_runtime_libs=no])
78 AC_MSG_RESULT($enable_version_specific_runtime_libs)
81 # Calculate toolexeclibdir
82 # Also toolexecdir, though it's only used in toolexeclibdir
83 case ${enable_version_specific_runtime_libs} in
84   yes)
85     # Need the gcc compiler version to know where to install libraries
86     # and header files if --enable-version-specific-runtime-libs option
87     # is selected.
88     toolexecdir='$(libdir)/gcc/$(target_alias)'
89    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
90     ;;
91   no)
92     if test -n "$with_cross_host" &&
93        test x"$with_cross_host" != x"no"; then
94       # Install a library built with a cross compiler in tooldir, not libdir.
95       toolexecdir='$(exec_prefix)/$(target_alias)'
96       toolexeclibdir='$(toolexecdir)/lib'
97     else
98       toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
99       toolexeclibdir='$(libdir)'
100     fi
101     multi_os_directory=`$CC -print-multi-os-directory`
102     case $multi_os_directory in
103       .) ;; # Avoid trailing /.
104       *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
105     esac
106     ;;
107 esac
109 # Set config_dir based on the target.  config_dir specifies where to get
110 # target-specific files.  The generic implementation is incomplete, but
111 # contains information on what's needed
112 case "${target}" in
114   x86_64-*-*)
115     config_dir="x86"
116     ;;
118   i[456]86-*-*)
119     config_dir="x86"
120     ;;
122   *)
123     config_dir="generic"
124     ;;
126 esac
127 AC_SUBST(config_dir)
129 # We have linker scripts for appropriate operating systems
130 linux_linker_script=no
131 case "${host}" in
132     *-*-linux*)
133         linux_linker_script=yes
134         ;;
135 esac
136 AM_CONDITIONAL(LINUX_LINKER_SCRIPT, test "$linux_linker_script" = "yes")
138 mac_linker_script=no
139 case "${host}" in
140     *-*-apple*)
141         mac_linker_script=yes
142         ;;
143 esac
144 AM_CONDITIONAL(MAC_LINKER_SCRIPT, test "$mac_linker_script" = "yes")
146 AM_PROG_LIBTOOL
147 AC_SUBST(toolexecdir)
148 AC_SUBST(toolexeclibdir)
150 # Must be last
151 AC_OUTPUT