2014-07-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / lto-plugin / configure.ac
blob6a5ae8a4ef5591e62d11ac11fd5b02019bdd591a
1 AC_PREREQ(2.64)
2 AC_INIT([LTO plugin for ld], 0.1,,[lto-plugin])
3 AC_CANONICAL_SYSTEM
4 GCC_TOPLEV_SUBDIRS
5 AM_INIT_AUTOMAKE([foreign no-dist])
6 AM_MAINTAINER_MODE
7 AC_ARG_WITH(libiberty,
8   [AS_HELP_STRING([--with-libiberty=PATH],
9     [specify the directory where to find libiberty [../libiberty]])],
10   [], with_libiberty=../libiberty)
11 AC_SUBST(with_libiberty)
12 AC_PROG_CC
13 AC_SYS_LARGEFILE
14 ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_lto_plugin_warn_cflags])
16 # Check whether -static-libgcc is supported.
17 saved_LDFLAGS="$LDFLAGS"
18 LDFLAGS="$LDFLAGS -static-libgcc"
19 AC_MSG_CHECKING([for -static-libgcc])
20 AC_LINK_IFELSE([
21   int main() {}], [have_static_libgcc=yes], [have_static_libgcc=no])
22 AC_MSG_RESULT($have_static_libgcc); 
23 LDFLAGS="$saved_LDFLAGS"
24 # Need -Wc to get it through libtool.
25 if test "x$have_static_libgcc" = xyes; then
26    ac_lto_plugin_ldflags="-Wc,-static-libgcc"
28 AC_SUBST(ac_lto_plugin_ldflags)
30 AM_PROG_LIBTOOL
31 ACX_LT_HOST_FLAGS
32 AC_SUBST(target_noncanonical)
33 AC_TYPE_INT64_T
34 AC_TYPE_UINT64_T
35 AC_HEADER_SYS_WAIT
36 AC_CONFIG_FILES(Makefile)
37 AC_CONFIG_HEADERS(config.h)
38 AC_OUTPUT