configure.ac 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. dnl Copyright (C) 2014-2022 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/>.
  18. AC_INIT([libcc1], [version-unused])
  19. AC_CONFIG_SRCDIR([libcc1.cc])
  20. AC_CONFIG_HEADER(cc1plugin-config.h)
  21. AC_CANONICAL_SYSTEM
  22. AC_USE_SYSTEM_EXTENSIONS
  23. # Determine the noncanonical target name, for directory use.
  24. ACX_NONCANONICAL_TARGET
  25. GCC_TOPLEV_SUBDIRS
  26. # 1.11.1: Require that version of automake.
  27. # foreign: Don't require README, INSTALL, NEWS, etc.
  28. # no-define: Don't define PACKAGE and VERSION.
  29. # -Wall: Issue all automake warnings.
  30. # -Wno-portability: Don't warn about constructs supported by GNU make.
  31. # (because GCC requires GNU make anyhow).
  32. AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define -Wall -Wno-portability])
  33. AM_MAINTAINER_MODE
  34. LT_INIT([disable-static])
  35. AM_PROG_LIBTOOL
  36. AC_PROG_CXX
  37. visibility=
  38. if test "$GXX" = yes; then
  39. visibility=-fvisibility=hidden
  40. fi
  41. AC_SUBST(visibility)
  42. GCC_CET_HOST_FLAGS(CET_HOST_FLAGS)
  43. AC_SUBST(CET_HOST_FLAGS)
  44. AC_CHECK_DECLS([basename])
  45. GCC_BASE_VER
  46. if test x$with_gcc_major_version_only = xyes ; then
  47. changequote(,)dnl
  48. gcc_version=`sed -e 's/^\([0-9]*\).*$/\1/' $srcdir/../gcc/BASE-VER`
  49. changequote([,])dnl
  50. else
  51. gcc_version=`cat $srcdir/../gcc/BASE-VER`
  52. fi
  53. AC_SUBST(gcc_version)
  54. AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/../gcc/BASE-VER'])
  55. ACX_PROG_CC_WARNING_OPTS([-W -Wall], [WARN_FLAGS])
  56. AC_SUBST(WARN_FLAGS)
  57. ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
  58. AC_ARG_VAR(GMPINC,[How to find GMP include files])
  59. libsuffix=
  60. if test "$GXX" = yes; then
  61. libsuffix=`$CXX -print-multi-os-directory`
  62. fi
  63. AC_SUBST(libsuffix)
  64. dnl Test for -lsocket and -lnsl. Copied from libgo/configure.ac.
  65. AC_CACHE_CHECK([for socket libraries], libcc1_cv_lib_sockets,
  66. [libcc1_cv_lib_sockets=
  67. libcc1_check_both=no
  68. AC_CHECK_FUNC(connect, libcc1_check_socket=no, libcc1_check_socket=yes)
  69. if test "$libcc1_check_socket" = "yes"; then
  70. unset ac_cv_func_connect
  71. AC_CHECK_LIB(socket, main, libcc1_cv_lib_sockets="-lsocket",
  72. libcc1_check_both=yes)
  73. fi
  74. if test "$libcc1_check_both" = "yes"; then
  75. libcc1_old_libs=$LIBS
  76. LIBS="$LIBS -lsocket -lnsl"
  77. unset ac_cv_func_accept
  78. AC_CHECK_FUNC(accept,
  79. [libcc1_check_nsl=no
  80. libcc1_cv_lib_sockets="-lsocket -lnsl"])
  81. unset ac_cv_func_accept
  82. LIBS=$libcc1_old_libs
  83. fi
  84. unset ac_cv_func_gethostbyname
  85. libcc1_old_libs="$LIBS"
  86. AC_CHECK_FUNC(gethostbyname, ,
  87. [AC_CHECK_LIB(nsl, main,
  88. [libcc1_cv_lib_sockets="$libcc1_cv_lib_sockets -lnsl"])])
  89. unset ac_cv_func_gethostbyname
  90. LIBS=$libcc1_old_libs
  91. ])
  92. LIBS="$LIBS $libcc1_cv_lib_sockets"
  93. case "$host" in
  94. *-*-darwin*) darwin_dynamic_lookup=yes ;;
  95. *) darwin_dynamic_lookup=no ;;
  96. esac
  97. AM_CONDITIONAL(DARWIN_DYNAMIC_LOOKUP, test $darwin_dynamic_lookup = yes)
  98. # If any of these functions are missing, simply don't bother building
  99. # this plugin.
  100. GCC_ENABLE_PLUGINS
  101. AC_CHECK_FUNC(socketpair, , enable_plugin=no)
  102. AC_CHECK_FUNC(select, , enable_plugin=no)
  103. AC_CHECK_FUNC(fork, , enable_plugin=no)
  104. AM_CONDITIONAL(ENABLE_PLUGIN, test $enable_plugin = yes)
  105. AC_CONFIG_FILES([Makefile])
  106. AC_OUTPUT