1 # Plugin for offload execution on Intel MIC devices.
3 # Copyright (C) 2014 Free Software Foundation, Inc.
5 # Contributed by Andrey Turetskiy <andrey.turetskiy@intel.com>.
7 # This file is part of the GNU OpenMP Library (libgomp).
9 # Libgomp is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3, or (at your option)
14 # Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 # Under Section 7 of GPL version 3, you are granted additional
20 # permissions described in the GCC Runtime Library Exception, version
21 # 3.1, as published by the Free Software Foundation.
23 # You should have received a copy of the GNU General Public License and
24 # a copy of the GCC Runtime Library Exception along with this program;
25 # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 # <http://www.gnu.org/licenses/>.
28 # Process this file with autoconf to produce a configure script, like so:
29 # aclocal -I ../.. -I ../../config && autoconf && automake
32 AC_INIT([Intel MIC Offload Plugin], [1.0], ,[libgomp-plugin-intelmic])
34 AC_CONFIG_AUX_DIR(../..)
37 target_alias=${target_alias-$host_alias}
38 AC_SUBST(target_alias)
40 AM_INIT_AUTOMAKE([1.9.0 foreign no-dist])
46 AC_CONFIG_FILES([Makefile])
47 AM_ENABLE_MULTILIB(, ../..)
49 if test "${multilib}" = "yes"; then
50 multilib_arg="--enable-multilib"
55 # Make sure liboffloadmic is enabled
56 case "$enable_liboffloadmic" in
60 AC_MSG_ERROR([Liboffloadmic is disabled]) ;;
62 AM_CONDITIONAL(PLUGIN_HOST, [test x"$enable_liboffloadmic" = xhost])
64 # Get accel target and path to build or install tree of accel compiler
67 if test x"$enable_liboffloadmic" = xhost; then
68 for accel in `echo $enable_offload_targets | sed -e 's#,# #g'`; do
69 accel_name=`echo $accel | sed 's/=.*//'`
70 accel_dir=`echo $accel | grep '=' | sed 's/.*=//'`
72 *-intelmic-* | *-intelmicemul-*)
73 accel_target=$accel_name
74 accel_search_dir=$accel_dir
78 if test x"$accel_target" = x; then
79 AC_MSG_ERROR([--enable-offload-targets does not contain intelmic target])
82 AC_SUBST(accel_search_dir)
83 AC_SUBST(accel_target)
85 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
86 AC_ARG_ENABLE([version-specific-runtime-libs],
87 AC_HELP_STRING([--enable-version-specific-runtime-libs],
88 [Specify that runtime libraries should be installed in a compiler-specific directory]),
90 yes) enable_version_specific_runtime_libs=yes ;;
91 no) enable_version_specific_runtime_libs=no ;;
92 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
94 [enable_version_specific_runtime_libs=no])
95 AC_MSG_RESULT($enable_version_specific_runtime_libs)
98 # Calculate toolexeclibdir.
99 # Also toolexecdir, though it's only used in toolexeclibdir.
100 case ${enable_version_specific_runtime_libs} in
102 # Need the gcc compiler version to know where to install libraries
103 # and header files if --enable-version-specific-runtime-libs option
105 toolexecdir='$(libdir)/gcc/$(target_alias)'
106 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
109 if test -n "$with_cross_host" &&
110 test x"$with_cross_host" != x"no"; then
111 # Install a library built with a cross compiler in tooldir, not libdir.
112 toolexecdir='$(exec_prefix)/$(target_alias)'
113 toolexeclibdir='$(toolexecdir)/lib'
115 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
116 toolexeclibdir='$(libdir)'
118 multi_os_directory=`$CC -print-multi-os-directory`
119 case $multi_os_directory in
120 .) ;; # Avoid trailing /.
121 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
128 # Forbid libtool to hardcode RPATH, because we want to be able to specify
129 # library search directory using LD_LIBRARY_PATH
130 hardcode_into_libs=no
131 AC_SUBST(toolexecdir)
132 AC_SUBST(toolexeclibdir)