annotate liboffloadmic/configure.ac @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 # Copyright (c) 2014 Intel Corporation. All Rights Reserved.
kono
parents:
diff changeset
2 #
kono
parents:
diff changeset
3 # Redistribution and use in source and binary forms, with or without
kono
parents:
diff changeset
4 # modification, are permitted provided that the following conditions
kono
parents:
diff changeset
5 # are met:
kono
parents:
diff changeset
6 #
kono
parents:
diff changeset
7 # * Redistributions of source code must retain the above copyright
kono
parents:
diff changeset
8 # notice, this list of conditions and the following disclaimer.
kono
parents:
diff changeset
9 # * Redistributions in binary form must reproduce the above copyright
kono
parents:
diff changeset
10 # notice, this list of conditions and the following disclaimer in the
kono
parents:
diff changeset
11 # documentation and/or other materials provided with the distribution.
kono
parents:
diff changeset
12 # * Neither the name of Intel Corporation nor the names of its
kono
parents:
diff changeset
13 # contributors may be used to endorse or promote products derived
kono
parents:
diff changeset
14 # from this software without specific prior written permission.
kono
parents:
diff changeset
15 #
kono
parents:
diff changeset
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
kono
parents:
diff changeset
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
kono
parents:
diff changeset
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
kono
parents:
diff changeset
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
kono
parents:
diff changeset
20 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
kono
parents:
diff changeset
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
kono
parents:
diff changeset
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
kono
parents:
diff changeset
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
kono
parents:
diff changeset
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
kono
parents:
diff changeset
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
kono
parents:
diff changeset
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 # Process this file with autoconf to produce a configure script, like so:
kono
parents:
diff changeset
29 # aclocal -I .. -I ../config && autoconf && automake
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 AC_INIT([MIC Offload Runtime Library], [1.0], ,[liboffloadmic])
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 AC_CANONICAL_SYSTEM
kono
parents:
diff changeset
34 target_alias=${target_alias-$host_alias}
kono
parents:
diff changeset
35 AC_SUBST(target_alias)
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 AM_INIT_AUTOMAKE(foreign no-dist)
kono
parents:
diff changeset
38 AM_MAINTAINER_MODE
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 AC_PROG_CC
kono
parents:
diff changeset
41 AC_PROG_CXX
kono
parents:
diff changeset
42 AC_CONFIG_FILES([Makefile liboffloadmic_host.spec liboffloadmic_target.spec])
kono
parents:
diff changeset
43 AM_ENABLE_MULTILIB(, ..)
kono
parents:
diff changeset
44 AC_CONFIG_SUBDIRS(plugin)
kono
parents:
diff changeset
45 AC_FUNC_ALLOCA
kono
parents:
diff changeset
46 AC_CHECK_HEADERS([mm_malloc.h], [], [AC_MSG_ERROR(["Couldn't find mm_malloc.h"])])
kono
parents:
diff changeset
47 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 # Get target configure.
kono
parents:
diff changeset
50 . ${srcdir}/configure.tgt
kono
parents:
diff changeset
51 if test -n "$UNSUPPORTED"; then
kono
parents:
diff changeset
52 AC_MSG_ERROR([Configuration ${target} is unsupported])
kono
parents:
diff changeset
53 fi
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 if test "${multilib}" = "yes"; then
kono
parents:
diff changeset
56 multilib_arg="--enable-multilib"
kono
parents:
diff changeset
57 else
kono
parents:
diff changeset
58 multilib_arg=
kono
parents:
diff changeset
59 fi
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
kono
parents:
diff changeset
62 AC_ARG_ENABLE([version-specific-runtime-libs],
kono
parents:
diff changeset
63 AC_HELP_STRING([--enable-version-specific-runtime-libs],
kono
parents:
diff changeset
64 [Specify that runtime libraries should be installed in a compiler-specific directory]),
kono
parents:
diff changeset
65 [case "$enableval" in
kono
parents:
diff changeset
66 yes) enable_version_specific_runtime_libs=yes ;;
kono
parents:
diff changeset
67 no) enable_version_specific_runtime_libs=no ;;
kono
parents:
diff changeset
68 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
kono
parents:
diff changeset
69 esac],
kono
parents:
diff changeset
70 [enable_version_specific_runtime_libs=no])
kono
parents:
diff changeset
71 AC_MSG_RESULT($enable_version_specific_runtime_libs)
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 # Make sure liboffloadmic is enabled
kono
parents:
diff changeset
74 case "$enable_liboffloadmic" in
kono
parents:
diff changeset
75 host | target)
kono
parents:
diff changeset
76 ;;
kono
parents:
diff changeset
77 *)
kono
parents:
diff changeset
78 AC_MSG_ERROR([Liboffloadmic is disabled]) ;;
kono
parents:
diff changeset
79 esac
kono
parents:
diff changeset
80 AM_CONDITIONAL(LIBOFFLOADMIC_HOST, [test x"$enable_liboffloadmic" = xhost])
kono
parents:
diff changeset
81
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
82 GCC_WITH_TOOLEXECLIBDIR
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
83
111
kono
parents:
diff changeset
84 # Calculate toolexeclibdir.
kono
parents:
diff changeset
85 # Also toolexecdir, though it's only used in toolexeclibdir.
kono
parents:
diff changeset
86 case ${enable_version_specific_runtime_libs} in
kono
parents:
diff changeset
87 yes)
kono
parents:
diff changeset
88 # Need the gcc compiler version to know where to install libraries
kono
parents:
diff changeset
89 # and header files if --enable-version-specific-runtime-libs option
kono
parents:
diff changeset
90 # is selected.
kono
parents:
diff changeset
91 toolexecdir='$(libdir)/gcc/$(target_alias)'
kono
parents:
diff changeset
92 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
kono
parents:
diff changeset
93 ;;
kono
parents:
diff changeset
94 no)
kono
parents:
diff changeset
95 if test -n "$with_cross_host" &&
kono
parents:
diff changeset
96 test x"$with_cross_host" != x"no"; then
kono
parents:
diff changeset
97 # Install a library built with a cross compiler in tooldir, not libdir.
kono
parents:
diff changeset
98 toolexecdir='$(exec_prefix)/$(target_alias)'
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
99 case ${with_toolexeclibdir} in
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
100 no)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
101 toolexeclibdir='$(toolexecdir)/lib'
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
102 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
103 *)
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
104 toolexeclibdir=${with_toolexeclibdir}
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
105 ;;
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
106 esac
111
kono
parents:
diff changeset
107 else
kono
parents:
diff changeset
108 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
kono
parents:
diff changeset
109 toolexeclibdir='$(libdir)'
kono
parents:
diff changeset
110 fi
kono
parents:
diff changeset
111 multi_os_directory=`$CC -print-multi-os-directory`
kono
parents:
diff changeset
112 case $multi_os_directory in
kono
parents:
diff changeset
113 .) ;; # Avoid trailing /.
kono
parents:
diff changeset
114 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
kono
parents:
diff changeset
115 esac
kono
parents:
diff changeset
116 ;;
kono
parents:
diff changeset
117 esac
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 AC_LIBTOOL_DLOPEN
kono
parents:
diff changeset
120 AM_PROG_LIBTOOL
kono
parents:
diff changeset
121 # Forbid libtool to hardcode RPATH, because we want to be able to specify
kono
parents:
diff changeset
122 # library search directory using LD_LIBRARY_PATH
kono
parents:
diff changeset
123 hardcode_into_libs=no
kono
parents:
diff changeset
124 AC_SUBST(toolexecdir)
kono
parents:
diff changeset
125 AC_SUBST(toolexeclibdir)
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 AC_SUBST(lt_cv_dlopen_libs)
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 if test $enable_shared = yes; then
kono
parents:
diff changeset
130 link_offloadmic_host="-loffloadmic_host %{static: $LIBS}"
kono
parents:
diff changeset
131 link_offloadmic_target="-loffloadmic_target %{static: $LIBS}"
kono
parents:
diff changeset
132 else
kono
parents:
diff changeset
133 link_offloadmic_host="-loffloadmic_host $LIBS"
kono
parents:
diff changeset
134 link_offloadmic_target="-loffloadmic_target $LIBS"
kono
parents:
diff changeset
135 fi
kono
parents:
diff changeset
136 AC_SUBST(link_offloadmic_host)
kono
parents:
diff changeset
137 AC_SUBST(link_offloadmic_target)
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 # Determine what GCC version number to use in filesystem paths.
kono
parents:
diff changeset
140 GCC_BASE_VER
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 # Must be last
kono
parents:
diff changeset
143 AC_OUTPUT