configure.ac 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # Configure script for libada.
  2. # Copyright (C) 2003-2015 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/unwind_ipinfo.m4)
  22. AC_INIT
  23. AC_PREREQ([2.64])
  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. # Very limited version of AC_MAINTAINER_MODE.
  36. AC_ARG_ENABLE([maintainer-mode],
  37. [AC_HELP_STRING([--enable-maintainer-mode],
  38. [enable make rules and dependencies not useful (and
  39. sometimes confusing) to the casual installer])],
  40. [case ${enable_maintainer_mode} in
  41. yes) MAINT='' ;;
  42. no) MAINT='#' ;;
  43. *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
  44. esac
  45. maintainer_mode=${enableval}],
  46. [MAINT='#'])
  47. AC_SUBST([MAINT])dnl
  48. AM_ENABLE_MULTILIB(, ..)
  49. # Calculate toolexeclibdir
  50. # Also toolexecdir, though it's only used in toolexeclibdir
  51. case ${enable_version_specific_runtime_libs} in
  52. yes)
  53. # Need the gcc compiler version to know where to install libraries
  54. # and header files if --enable-version-specific-runtime-libs option
  55. # is selected.
  56. toolexecdir='$(libdir)/gcc/$(target_alias)'
  57. toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
  58. ;;
  59. no)
  60. if test -n "$with_cross_host" &&
  61. test x"$with_cross_host" != x"no"; then
  62. # Install a library built with a cross compiler in tooldir, not libdir.
  63. toolexecdir='$(exec_prefix)/$(target_alias)'
  64. toolexeclibdir='$(toolexecdir)/lib'
  65. else
  66. toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
  67. toolexeclibdir='$(libdir)'
  68. fi
  69. multi_os_directory=`$CC -print-multi-os-directory`
  70. case $multi_os_directory in
  71. .) ;; # Avoid trailing /.
  72. *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
  73. esac
  74. ;;
  75. esac
  76. AC_SUBST(toolexecdir)
  77. AC_SUBST(toolexeclibdir)
  78. #TODO: toolexeclibdir is currently disregarded
  79. # Check the compiler.
  80. # The same as in boehm-gc and libstdc++. Have to borrow it from there.
  81. # We must force CC to /not/ be precious variables; otherwise
  82. # the wrong, non-multilib-adjusted value will be used in multilibs.
  83. # As a side effect, we have to subst CFLAGS ourselves.
  84. m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
  85. m4_define([_AC_ARG_VAR_PRECIOUS],[])
  86. AC_PROG_CC
  87. m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
  88. AC_SUBST(CFLAGS)
  89. AC_ARG_ENABLE([shared],
  90. [AC_HELP_STRING([--disable-shared],
  91. [don't provide a shared libgnat])],
  92. [
  93. case $enable_shared in
  94. yes | no) ;;
  95. *)
  96. enable_shared=no
  97. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  98. for pkg in $enableval; do
  99. case $pkg in
  100. ada | libada)
  101. enable_shared=yes ;;
  102. esac
  103. done
  104. IFS="$ac_save_ifs"
  105. ;;
  106. esac
  107. ], [enable_shared=yes])
  108. AC_SUBST([enable_shared])
  109. GCC_PICFLAG
  110. AC_SUBST([PICFLAG])
  111. # These must be passed down, or are needed by gcc/libgcc.mvars
  112. AC_PROG_AWK
  113. AC_PROG_LN_S
  114. # Determine what to build for 'gnatlib'
  115. if test $build = $target \
  116. && test ${enable_shared} = yes ; then
  117. # Note that build=target is almost certainly the wrong test; FIXME
  118. default_gnatlib_target="gnatlib-shared"
  119. else
  120. default_gnatlib_target="gnatlib-plain"
  121. fi
  122. AC_SUBST([default_gnatlib_target])
  123. # Check for _Unwind_GetIPInfo
  124. GCC_CHECK_UNWIND_GETIPINFO
  125. have_getipinfo=
  126. if test x$have_unwind_getipinfo = xyes; then
  127. have_getipinfo=-DHAVE_GETIPINFO
  128. fi
  129. AC_SUBST(have_getipinfo)
  130. # Output: create a Makefile.
  131. AC_CONFIG_FILES([Makefile])
  132. AC_OUTPUT