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