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