dump_printf: add "%C" for dumping cgraph_node *
[official-gcc.git] / libcc1 / configure.ac
blob8169d25ae4be19bfe9ce2fabbe1faf8ccb07e48e
1 dnl   Copyright (C) 2014-2018 Free Software Foundation, Inc.
2 dnl
3 dnl This file is part of GCC.
4 dnl
5 dnl GCC is free software; you can redistribute it and/or modify it under
6 dnl the terms of the GNU General Public License as published by the Free
7 dnl Software Foundation; either version 3, or (at your option) any later
8 dnl version.
9 dnl
10 dnl GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 dnl for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with GCC; see the file COPYING3.  If not see
17 dnl <http://www.gnu.org/licenses/>.
19 AC_INIT([libcc1], [version-unused])
20 AC_CONFIG_SRCDIR([libcc1.cc])
21 AC_CONFIG_HEADER(cc1plugin-config.h)
23 AC_CANONICAL_SYSTEM
24 AC_USE_SYSTEM_EXTENSIONS
25 # Determine the noncanonical target name, for directory use.
26 ACX_NONCANONICAL_TARGET
27 GCC_TOPLEV_SUBDIRS
29 # 1.11.1: Require that version of automake.
30 # foreign: Don't require README, INSTALL, NEWS, etc.
31 # no-define: Don't define PACKAGE and VERSION.
32 # -Wall: Issue all automake warnings.
33 # -Wno-portability: Don't warn about constructs supported by GNU make.
34 #    (because GCC requires GNU make anyhow).
35 AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define -Wall -Wno-portability])
36 AM_MAINTAINER_MODE
38 LT_INIT([disable-static])
39 AM_PROG_LIBTOOL
40 AC_PROG_CXX
42 visibility=
43 if test "$GXX" = yes; then
44   visibility=-fvisibility=hidden
46 AC_SUBST(visibility)
48 AC_CHECK_DECLS([basename])
50 GCC_BASE_VER
52 if test x$with_gcc_major_version_only = xyes ; then
53   changequote(,)dnl
54   gcc_version=`sed -e 's/^\([0-9]*\).*$/\1/' $srcdir/../gcc/BASE-VER`
55   changequote([,])dnl
56 else
57   gcc_version=`cat $srcdir/../gcc/BASE-VER`
59 AC_SUBST(gcc_version)
60 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/../gcc/BASE-VER'])
62 ACX_PROG_CC_WARNING_OPTS([-W -Wall], [WARN_FLAGS])
63 AC_SUBST(WARN_FLAGS)
64 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
66 AC_ARG_VAR(GMPINC,[How to find GMP include files])
68 libsuffix=
69 if test "$GXX" = yes; then
70   libsuffix=`$CXX -print-multi-os-directory`
72 AC_SUBST(libsuffix)
74 dnl Test for -lsocket and -lnsl.  Copied from libgo/configure.ac.
75 AC_CACHE_CHECK([for socket libraries], libcc1_cv_lib_sockets,
76   [libcc1_cv_lib_sockets=
77    libcc1_check_both=no
78    AC_CHECK_FUNC(connect, libcc1_check_socket=no, libcc1_check_socket=yes)
79    if test "$libcc1_check_socket" = "yes"; then
80      unset ac_cv_func_connect
81      AC_CHECK_LIB(socket, main, libcc1_cv_lib_sockets="-lsocket",
82                   libcc1_check_both=yes)
83    fi
84    if test "$libcc1_check_both" = "yes"; then
85      libcc1_old_libs=$LIBS
86      LIBS="$LIBS -lsocket -lnsl"
87      unset ac_cv_func_accept
88      AC_CHECK_FUNC(accept,
89                    [libcc1_check_nsl=no
90                     libcc1_cv_lib_sockets="-lsocket -lnsl"])
91      unset ac_cv_func_accept
92      LIBS=$libcc1_old_libs
93    fi
94    unset ac_cv_func_gethostbyname
95    libcc1_old_libs="$LIBS"
96    AC_CHECK_FUNC(gethostbyname, ,
97                  [AC_CHECK_LIB(nsl, main,
98                         [libcc1_cv_lib_sockets="$libcc1_cv_lib_sockets -lnsl"])])
99    unset ac_cv_func_gethostbyname
100    LIBS=$libcc1_old_libs
102 LIBS="$LIBS $libcc1_cv_lib_sockets"
104 # If any of these functions are missing, simply don't bother building
105 # this plugin.
106 GCC_ENABLE_PLUGINS
107 AC_CHECK_FUNC(socketpair, , enable_plugin=no)
108 AC_CHECK_FUNC(select, , enable_plugin=no)
109 AC_CHECK_FUNC(fork, , enable_plugin=no)
110 AM_CONDITIONAL(ENABLE_PLUGIN, test $enable_plugin = yes)
112 AC_CONFIG_FILES([Makefile])
113 AC_OUTPUT