1AC_INIT([LTO plugin for ld], 0.1,,[lto-plugin]) 2AC_CANONICAL_SYSTEM 3GCC_TOPLEV_SUBDIRS 4AM_INIT_AUTOMAKE([foreign no-dist]) 5AM_MAINTAINER_MODE 6AC_ARG_WITH(libiberty, 7 [AS_HELP_STRING([--with-libiberty=PATH], 8 [specify the directory where to find libiberty [../libiberty]])], 9 [], with_libiberty=../libiberty) 10AC_SUBST(with_libiberty) 11AC_USE_SYSTEM_EXTENSIONS 12AC_PROG_CC 13AC_SYS_LARGEFILE 14ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_lto_plugin_warn_cflags]) 15 16# Check whether -static-libgcc is supported. 17saved_LDFLAGS="$LDFLAGS" 18LDFLAGS="$LDFLAGS -static-libgcc" 19AC_MSG_CHECKING([for -static-libgcc]) 20AC_LINK_IFELSE([AC_LANG_SOURCE([ 21 int main() {}])], [have_static_libgcc=yes], [have_static_libgcc=no]) 22AC_MSG_RESULT($have_static_libgcc); 23LDFLAGS="$saved_LDFLAGS" 24# Need -Wc to get it through libtool. 25if test "x$have_static_libgcc" = xyes; then 26 ac_lto_plugin_ldflags="-Wc,-static-libgcc" 27fi 28AC_SUBST(ac_lto_plugin_ldflags) 29 30GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) 31AC_SUBST(CET_HOST_FLAGS) 32 33if test x"$host_subdir" = x.; then 34 gcc_build_dir=../gcc 35else 36 gcc_build_dir=../../$host_subdir/gcc 37fi 38AC_SUBST(gcc_build_dir) 39 40# Used for constructing correct paths for offload compilers. 41accel_dir_suffix= 42real_target_noncanonical=${target_noncanonical} 43if test x"$enable_as_accelerator_for" != x; then 44 accel_dir_suffix=/accel/${target_noncanonical} 45 real_target_noncanonical=${enable_as_accelerator_for} 46fi 47AC_SUBST(accel_dir_suffix) 48AC_SUBST(real_target_noncanonical) 49 50# Determine what GCC version number to use in filesystem paths. 51GCC_BASE_VER 52 53AM_PROG_LIBTOOL 54ACX_LT_HOST_FLAGS 55AC_SUBST(target_noncanonical) 56AC_TYPE_INT64_T 57AC_TYPE_UINT64_T 58AC_HEADER_SYS_WAIT 59AC_CONFIG_FILES(Makefile) 60AC_CONFIG_HEADERS(config.h) 61AC_OUTPUT 62