summaryrefslogtreecommitdiff
path: root/lto-plugin/configure.ac
blob: c3ae93e12a7e8bbd2dd31bbe791a8312c6ab725a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
AC_PREREQ(2.64)
AC_INIT([LTO plugin for ld], 0.1,,[lto-plugin])
AC_CANONICAL_SYSTEM
GCC_TOPLEV_SUBDIRS
AM_INIT_AUTOMAKE([foreign no-dist])
AM_MAINTAINER_MODE
AC_ARG_WITH(libiberty,
  [AS_HELP_STRING([--with-libiberty=PATH],
    [specify the directory where to find libiberty [../libiberty]])],
  [], with_libiberty=../libiberty)
AC_SUBST(with_libiberty)
AC_PROG_CC
AC_SYS_LARGEFILE
ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_lto_plugin_warn_cflags])

# Check whether -static-libgcc is supported.
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static-libgcc"
AC_MSG_CHECKING([for -static-libgcc])
AC_LINK_IFELSE([
  int main() {}], [have_static_libgcc=yes], [have_static_libgcc=no])
AC_MSG_RESULT($have_static_libgcc); 
LDFLAGS="$saved_LDFLAGS"
# Need -Wc to get it through libtool.
if test "x$have_static_libgcc" = xyes; then
   ac_lto_plugin_ldflags="-Wc,-static-libgcc"
fi
AC_SUBST(ac_lto_plugin_ldflags)

if test x"$host_subdir" = x.; then
   gcc_build_dir=../gcc
else
   gcc_build_dir=../../$host_subdir/gcc
fi
AC_SUBST(gcc_build_dir)

AM_PROG_LIBTOOL
ACX_LT_HOST_FLAGS
AC_SUBST(target_noncanonical)
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
AC_HEADER_SYS_WAIT
AC_CONFIG_FILES(Makefile)
AC_CONFIG_HEADERS(config.h)
AC_OUTPUT