Fix GNU coding style for G_.
[official-gcc.git] / liboffloadmic / plugin / configure.ac
blob9c48cafd38b1ca5457da27895d491e59f8fffeda
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 Offloading and Multi Processing Library
8 # (libgomp).
10 # Libgomp is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3, or (at your option)
13 # any later version.
15 # Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18 # more details.
20 # Under Section 7 of GPL version 3, you are granted additional
21 # permissions described in the GCC Runtime Library Exception, version
22 # 3.1, as published by the Free Software Foundation.
24 # You should have received a copy of the GNU General Public License and
25 # a copy of the GCC Runtime Library Exception along with this program;
26 # see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
27 # <http://www.gnu.org/licenses/>.
29 # Process this file with autoconf to produce a configure script, like so:
30 # aclocal -I ../.. -I ../../config && autoconf && automake
32 AC_PREREQ([2.64])
33 AC_INIT([Intel MIC Offload Plugin], [1.0], ,[libgomp-plugin-intelmic])
35 AC_CONFIG_AUX_DIR(../..)
37 AC_CANONICAL_SYSTEM
38 target_alias=${target_alias-$host_alias}
39 AC_SUBST(target_alias)
41 AM_INIT_AUTOMAKE([1.9.0 foreign no-dist])
43 AM_MAINTAINER_MODE
45 AC_PROG_CC
46 AC_PROG_CXX
47 AC_CONFIG_FILES([Makefile])
48 AM_ENABLE_MULTILIB(, ../..)
50 if test "${multilib}" = "yes"; then
51   multilib_arg="--enable-multilib"
52 else
53   multilib_arg=
56 # Make sure liboffloadmic is enabled
57 case "$enable_liboffloadmic" in
58   host | target)
59     ;;
60   *)
61     AC_MSG_ERROR([Liboffloadmic is disabled]) ;;
62 esac
63 AM_CONDITIONAL(PLUGIN_HOST, [test x"$enable_liboffloadmic" = xhost])
65 # Get accel target and path to build or install tree of accel compiler
66 accel_search_dir=
67 accel_target=
68 if test x"$enable_liboffloadmic" = xhost; then
69   for accel in `echo $enable_offload_targets | sed -e 's#,# #g'`; do
70     accel_name=`echo $accel | sed 's/=.*//'`
71     accel_dir=`echo $accel | grep '=' | sed 's/.*=//'`
72     case "$accel_name" in
73       *-intelmic-* | *-intelmicemul-*)
74         accel_target=$accel_name
75         accel_search_dir=$accel_dir
76         ;;
77     esac
78   done
79   if test x"$accel_target" = x; then
80     AC_MSG_ERROR([--enable-offload-targets does not contain intelmic target])
81   fi
83 AC_SUBST(accel_search_dir)
84 AC_SUBST(accel_target)
86 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
87 AC_ARG_ENABLE([version-specific-runtime-libs],
88   AC_HELP_STRING([--enable-version-specific-runtime-libs],
89                  [Specify that runtime libraries should be installed in a compiler-specific directory]),
90   [case "$enableval" in
91     yes) enable_version_specific_runtime_libs=yes ;;
92     no)  enable_version_specific_runtime_libs=no ;;
93     *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
94    esac],
95   [enable_version_specific_runtime_libs=no])
96 AC_MSG_RESULT($enable_version_specific_runtime_libs)
99 # Calculate toolexeclibdir.
100 # Also toolexecdir, though it's only used in toolexeclibdir.
101 case ${enable_version_specific_runtime_libs} in
102   yes)
103     # Need the gcc compiler version to know where to install libraries
104     # and header files if --enable-version-specific-runtime-libs option
105     # is selected.
106     toolexecdir='$(libdir)/gcc/$(target_alias)'
107     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
108     ;;
109   no)
110     if test -n "$with_cross_host" &&
111        test x"$with_cross_host" != x"no"; then
112       # Install a library built with a cross compiler in tooldir, not libdir.
113       toolexecdir='$(exec_prefix)/$(target_alias)'
114       toolexeclibdir='$(toolexecdir)/lib'
115     else
116       toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
117       toolexeclibdir='$(libdir)'
118     fi
119     multi_os_directory=`$CC -print-multi-os-directory`
120     case $multi_os_directory in
121       .) ;; # Avoid trailing /.
122       *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
123     esac
124     ;;
125 esac
127 AC_LIBTOOL_DLOPEN
128 AM_PROG_LIBTOOL
129 # Forbid libtool to hardcode RPATH, because we want to be able to specify
130 # library search directory using LD_LIBRARY_PATH
131 hardcode_into_libs=no
132 AC_SUBST(toolexecdir)
133 AC_SUBST(toolexeclibdir)
135 # Determine what GCC version number to use in filesystem paths.
136 GCC_BASE_VER
138 # Must be last
139 AC_OUTPUT