configure.ac 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. # Configure script for libada.
  2. # Copyright (C) 2003-2022 Free Software Foundation, Inc.
  3. #
  4. # This file is free software; you can redistribute it and/or modify it
  5. # under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; see the file COPYING3. If not see
  16. # <http://www.gnu.org/licenses/>.
  17. sinclude(../config/acx.m4)
  18. sinclude(../config/multi.m4)
  19. sinclude(../config/override.m4)
  20. sinclude(../config/picflag.m4)
  21. sinclude(../config/toolexeclibdir.m4)
  22. sinclude(../config/unwind_ipinfo.m4)
  23. AC_INIT
  24. AC_CONFIG_SRCDIR([Makefile.in])
  25. # Determine the host, build, and target systems
  26. AC_CANONICAL_BUILD
  27. AC_CANONICAL_HOST
  28. AC_CANONICAL_TARGET
  29. target_alias=${target_alias-$host_alias}
  30. # Determine the noncanonical target name, for directory use.
  31. ACX_NONCANONICAL_TARGET
  32. # Determine the target- and build-specific subdirectories
  33. GCC_TOPLEV_SUBDIRS
  34. # Command-line options.
  35. AC_ARG_ENABLE(version-specific-runtime-libs,
  36. [AS_HELP_STRING([--enable-version-specific-runtime-libs],
  37. [specify that runtime libraries should be
  38. installed in a compiler-specific directory])],
  39. [case "$enableval" in
  40. yes|no)
  41. ;;
  42. *)
  43. AC_MSG_ERROR([--enable-version-specific-runtime-libs must be yes or no])
  44. ;;
  45. esac],
  46. [enable_version_specific_runtime_libs=yes]
  47. )
  48. # Very limited version of AC_MAINTAINER_MODE.
  49. AC_ARG_ENABLE([maintainer-mode],
  50. [AC_HELP_STRING([--enable-maintainer-mode],
  51. [enable make rules and dependencies not useful (and
  52. sometimes confusing) to the casual installer])],
  53. [case ${enable_maintainer_mode} in
  54. yes) MAINT='' ;;
  55. no) MAINT='#' ;;
  56. *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
  57. esac
  58. maintainer_mode=${enableval}],
  59. [MAINT='#'])
  60. AC_SUBST([MAINT])dnl
  61. GCC_WITH_TOOLEXECLIBDIR
  62. AM_ENABLE_MULTILIB(, ..)
  63. # Calculate toolexeclibdir
  64. # Also toolexecdir, though it's only used in toolexeclibdir
  65. case ${enable_version_specific_runtime_libs} in
  66. yes)
  67. # Need the gcc compiler version to know where to install libraries
  68. # and header files if --enable-version-specific-runtime-libs option
  69. # is selected.
  70. toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
  71. toolexeclibdir='$(toolexecdir)/$(version)$(MULTISUBDIR)/adalib'
  72. ;;
  73. no)
  74. if test -n "$with_cross_host" &&
  75. test x"$with_cross_host" != x"no"; then
  76. # Install a library built with a cross compiler in tooldir, not libdir.
  77. toolexecdir='$(exec_prefix)/$(target_alias)'
  78. case ${with_toolexeclibdir} in
  79. no)
  80. toolexeclibdir='$(toolexecdir)/lib'
  81. ;;
  82. *)
  83. toolexeclibdir=${with_toolexeclibdir}
  84. ;;
  85. esac
  86. else
  87. toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
  88. toolexeclibdir='$(libdir)'
  89. fi
  90. multi_os_directory=`$CC -print-multi-os-directory`
  91. case $multi_os_directory in
  92. .) ;; # Avoid trailing /.
  93. *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
  94. esac
  95. ;;
  96. esac
  97. AC_SUBST(toolexecdir)
  98. AC_SUBST(toolexeclibdir)
  99. # Check the compiler.
  100. # The same as in boehm-gc and libstdc++. Have to borrow it from there.
  101. # We must force CC to /not/ be precious variables; otherwise
  102. # the wrong, non-multilib-adjusted value will be used in multilibs.
  103. # As a side effect, we have to subst CFLAGS ourselves.
  104. m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
  105. m4_define([_AC_ARG_VAR_PRECIOUS],[])
  106. AC_PROG_CC
  107. m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
  108. AC_SUBST(CFLAGS)
  109. AC_ARG_ENABLE([shared],
  110. [AC_HELP_STRING([--disable-shared],
  111. [don't provide a shared libgnat])],
  112. [
  113. case $enable_shared in
  114. yes | no) ;;
  115. *)
  116. enable_shared=no
  117. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  118. for pkg in $enableval; do
  119. case $pkg in
  120. ada | libada)
  121. enable_shared=yes ;;
  122. esac
  123. done
  124. IFS="$ac_save_ifs"
  125. ;;
  126. esac
  127. ], [enable_shared=yes])
  128. AC_SUBST([enable_shared])
  129. GCC_PICFLAG
  130. AC_SUBST([PICFLAG])
  131. # These must be passed down, or are needed by gcc/libgcc.mvars
  132. AC_PROG_AWK
  133. AC_PROG_LN_S
  134. # Determine what to build for 'gnatlib'
  135. if test ${enable_shared} = yes; then
  136. default_gnatlib_target="gnatlib-shared"
  137. else
  138. default_gnatlib_target="gnatlib"
  139. fi
  140. AC_SUBST([default_gnatlib_target])
  141. # Check for _Unwind_GetIPInfo
  142. GCC_CHECK_UNWIND_GETIPINFO
  143. if test x$have_unwind_getipinfo = xyes; then
  144. have_getipinfo=-DHAVE_GETIPINFO
  145. else
  146. have_getipinfo=
  147. fi
  148. AC_SUBST([have_getipinfo])
  149. # Check for <sys/capability.h>
  150. AC_CHECK_HEADER([sys/capability.h], have_capability=-DHAVE_CAPABILITY, have_capability=)
  151. AC_SUBST([have_capability])
  152. # Determine what GCC version number to use in filesystem paths.
  153. GCC_BASE_VER
  154. # Output: create a Makefile.
  155. AC_CONFIG_FILES([Makefile])
  156. AC_OUTPUT