111
|
1 # Starting point copied from libcilkrts:
|
|
2 #
|
|
3 # @copyright
|
|
4 # Copyright (C) 2011-2013, Intel Corporation
|
|
5 # All rights reserved.
|
|
6 #
|
|
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:
|
|
11 #
|
|
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.
|
|
21 #
|
|
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.
|
|
35
|
|
36 AC_INIT([phsa HSAIL runtime library], [1.0], [pekka.jaaskelainen@parmance.com])
|
|
37
|
|
38 # Needed to define ${target}. Needs to be very early to avoid annoying
|
|
39 # warning about calling AC_ARG_PROGRAM before AC_CANONICAL_SYSTEM
|
|
40 AC_CANONICAL_SYSTEM
|
|
41 target_alias=${target_alias-$host_alias}
|
|
42 AC_SUBST(target_alias)
|
|
43 AM_INIT_AUTOMAKE([1.11.6 foreign no-dist])
|
|
44
|
|
45 AM_MAINTAINER_MODE
|
|
46
|
|
47 AC_PROG_CC
|
|
48 AC_PROG_CXX
|
|
49 # AC_PROG_LIBTOOL
|
|
50 AC_CONFIG_FILES([Makefile])
|
|
51
|
|
52 if test "${multilib}" = "yes"; then
|
|
53 multilib_arg="--enable-multilib"
|
|
54 else
|
|
55 multilib_arg=
|
|
56 fi
|
|
57
|
|
58 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
|
59 AC_ARG_ENABLE([version-specific-runtime-libs],
|
|
60 AC_HELP_STRING([--enable-version-specific-runtime-libs],
|
|
61 [Specify that runtime libraries should be installed in a compi
|
|
62 ler-specific directory]),
|
|
63 [case "$enableval" in
|
|
64 yes) enable_version_specific_runtime_libs=yes ;;
|
|
65 no) enable_version_specific_runtime_libs=no ;;
|
|
66 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs
|
|
67 ]);;
|
|
68 esac],
|
|
69 [enable_version_specific_runtime_libs=no])
|
|
70 AC_MSG_RESULT($enable_version_specific_runtime_libs)
|
|
71
|
145
|
72 GCC_WITH_TOOLEXECLIBDIR
|
|
73
|
111
|
74 # Calculate toolexeclibdir
|
|
75 # Also toolexecdir, though it's only used in toolexeclibdir
|
|
76 case ${enable_version_specific_runtime_libs} in
|
|
77 yes)
|
|
78 # Need the gcc compiler version to know where to install libraries
|
|
79 # and header files if --enable-version-specific-runtime-libs option
|
|
80 # is selected.
|
|
81 toolexecdir='$(libdir)/gcc/$(target_alias)'
|
|
82 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
|
83 ;;
|
|
84 no)
|
|
85 if test -n "$with_cross_host" &&
|
|
86 test x"$with_cross_host" != x"no"; then
|
|
87 # Install a library built with a cross compiler in tooldir, not libdir.
|
|
88 toolexecdir='$(exec_prefix)/$(target_alias)'
|
145
|
89 case ${with_toolexeclibdir} in
|
|
90 no)
|
|
91 toolexeclibdir='$(toolexecdir)/lib'
|
|
92 ;;
|
|
93 *)
|
|
94 toolexeclibdir=${with_toolexeclibdir}
|
|
95 ;;
|
|
96 esac
|
111
|
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
|
|
108
|
|
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
|
|
113
|
|
114 x86_64-*-*)
|
|
115 config_dir="x86"
|
|
116 ;;
|
|
117
|
|
118 i?86-*-*)
|
|
119 config_dir="x86"
|
|
120 ;;
|
|
121
|
|
122 *)
|
|
123 config_dir="generic"
|
|
124 ;;
|
|
125
|
|
126 esac
|
|
127 AC_SUBST(config_dir)
|
|
128
|
|
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")
|
|
137
|
|
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")
|
|
145
|
|
146 AC_LIBTOOL_DLOPEN
|
|
147 AM_PROG_LIBTOOL
|
|
148 AC_SUBST(toolexecdir)
|
|
149 AC_SUBST(toolexeclibdir)
|
|
150
|
|
151 AC_CONFIG_HEADER(target-config.h)
|
|
152
|
|
153 AC_CHECK_SIZEOF([int])
|
|
154 AC_CHECK_SIZEOF([void*])
|
|
155
|
|
156 # Determine what GCC version number to use in filesystem paths.
|
|
157 GCC_BASE_VER
|
|
158
|
|
159 # Must be last
|
|
160 AC_OUTPUT
|