configure.ac revision 1.1.1.8
1dnl Copyright (C) 2014-2020 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_INIT([libcc1], [version-unused]) 20AC_CONFIG_SRCDIR([libcc1.cc]) 21AC_CONFIG_HEADER(cc1plugin-config.h) 22 23AC_CANONICAL_SYSTEM 24AC_USE_SYSTEM_EXTENSIONS 25# Determine the noncanonical target name, for directory use. 26ACX_NONCANONICAL_TARGET 27GCC_TOPLEV_SUBDIRS 28 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). 35AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define -Wall -Wno-portability]) 36AM_MAINTAINER_MODE 37 38LT_INIT([disable-static]) 39AM_PROG_LIBTOOL 40AC_PROG_CXX 41 42visibility= 43if test "$GXX" = yes; then 44 visibility=-fvisibility=hidden 45fi 46AC_SUBST(visibility) 47 48AC_CHECK_DECLS([basename]) 49 50GCC_BASE_VER 51 52if 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 56else 57 gcc_version=`cat $srcdir/../gcc/BASE-VER` 58fi 59AC_SUBST(gcc_version) 60AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/../gcc/BASE-VER']) 61 62ACX_PROG_CC_WARNING_OPTS([-W -Wall], [WARN_FLAGS]) 63AC_SUBST(WARN_FLAGS) 64ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual]) 65 66AC_ARG_VAR(GMPINC,[How to find GMP include files]) 67 68libsuffix= 69if test "$GXX" = yes; then 70 libsuffix=`$CXX -print-multi-os-directory` 71fi 72AC_SUBST(libsuffix) 73 74dnl Test for -lsocket and -lnsl. Copied from libgo/configure.ac. 75AC_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 101]) 102LIBS="$LIBS $libcc1_cv_lib_sockets" 103 104case "$host" in 105 *-*-darwin*) darwin_dynamic_lookup=yes ;; 106 *) darwin_dynamic_lookup=no ;; 107esac 108AM_CONDITIONAL(DARWIN_DYNAMIC_LOOKUP, test $darwin_dynamic_lookup = yes) 109 110# If any of these functions are missing, simply don't bother building 111# this plugin. 112GCC_ENABLE_PLUGINS 113AC_CHECK_FUNC(socketpair, , enable_plugin=no) 114AC_CHECK_FUNC(select, , enable_plugin=no) 115AC_CHECK_FUNC(fork, , enable_plugin=no) 116AM_CONDITIONAL(ENABLE_PLUGIN, test $enable_plugin = yes) 117 118AC_CONFIG_FILES([Makefile]) 119AC_OUTPUT 120