1 dnl Copyright (C) 2014 Free Software Foundation, Inc.
3 dnl This file is part of GCC.
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
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
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/>.
20 AC_INIT([libcc1], [version-unused])
21 AC_CONFIG_SRCDIR([libcc1.cc])
22 AC_CONFIG_HEADER(cc1plugin-config.h)
25 AC_USE_SYSTEM_EXTENSIONS
26 # Determine the noncanonical target name, for directory use.
27 ACX_NONCANONICAL_TARGET
30 # 1.11.1: Require that version of automake.
31 # foreign: Don't require README, INSTALL, NEWS, etc.
32 # no-define: Don't define PACKAGE and VERSION.
33 # -Wall: Issue all automake warnings.
34 # -Wno-portability: Don't warn about constructs supported by GNU make.
35 # (because GCC requires GNU make anyhow).
36 AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define -Wall -Wno-portability])
39 LT_INIT([disable-static])
44 if test "$GXX" = yes; then
45 visibility=-fvisibility=hidden
49 AC_CHECK_DECLS([basename])
51 gcc_version=`cat $srcdir/../gcc/BASE-VER`
53 AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/../gcc/BASE-VER'])
55 ACX_PROG_CC_WARNING_OPTS([-W -Wall], [WARN_FLAGS])
57 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
59 AC_ARG_VAR(GMPINC,[How to find GMP include files])
62 if test "$GXX" = yes; then
63 libsuffix=`$CXX -print-multi-os-directory`
67 dnl Test for -lsocket and -lnsl. Copied from libgo/configure.ac.
68 AC_CACHE_CHECK([for socket libraries], libcc1_cv_lib_sockets,
69 [libcc1_cv_lib_sockets=
71 AC_CHECK_FUNC(connect, libcc1_check_socket=no, libcc1_check_socket=yes)
72 if test "$libcc1_check_socket" = "yes"; then
73 unset ac_cv_func_connect
74 AC_CHECK_LIB(socket, main, libcc1_cv_lib_sockets="-lsocket",
75 libcc1_check_both=yes)
77 if test "$libcc1_check_both" = "yes"; then
79 LIBS="$LIBS -lsocket -lnsl"
80 unset ac_cv_func_accept
83 libcc1_cv_lib_sockets="-lsocket -lnsl"])
84 unset ac_cv_func_accept
87 unset ac_cv_func_gethostbyname
88 libcc1_old_libs="$LIBS"
89 AC_CHECK_FUNC(gethostbyname, ,
90 [AC_CHECK_LIB(nsl, main,
91 [libcc1_cv_lib_sockets="$libcc1_cv_lib_sockets -lnsl"])])
92 unset ac_cv_func_gethostbyname
95 LIBS="$LIBS $libcc1_cv_lib_sockets"
97 # If any of these functions are missing, simply don't bother building
100 AC_CHECK_FUNC(socketpair, , enable_plugin=no)
101 AC_CHECK_FUNC(select, , enable_plugin=no)
102 AC_CHECK_FUNC(fork, , enable_plugin=no)
103 AM_CONDITIONAL(ENABLE_PLUGIN, test $enable_plugin = yes)
105 AC_CONFIG_FILES([Makefile])