configure.ac 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Configure script for libada.
  2. # Copyright 2003, 2004, 2009, 2012 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/override.m4)
  19. AC_INIT
  20. AC_CONFIG_SRCDIR([Makefile.in])
  21. # Command-line options.
  22. # Very limited version of AC_MAINTAINER_MODE.
  23. AC_ARG_ENABLE([maintainer-mode],
  24. [AC_HELP_STRING([--enable-maintainer-mode],
  25. [enable make rules and dependencies not useful (and
  26. sometimes confusing) to the casual installer])],
  27. [case ${enable_maintainer_mode} in
  28. yes) MAINT='' ;;
  29. no) MAINT='#' ;;
  30. *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
  31. esac
  32. maintainer_mode=${enableval}],
  33. [MAINT='#'])
  34. AC_SUBST([MAINT])dnl
  35. # Start of actual configure tests
  36. AC_PROG_INSTALL
  37. AC_CANONICAL_BUILD
  38. AC_CANONICAL_HOST
  39. AC_CANONICAL_TARGET
  40. ACX_NONCANONICAL_HOST
  41. ACX_NONCANONICAL_TARGET
  42. # Need to pass this down for now :-P
  43. AC_PROG_LN_S
  44. # Target-specific stuff (defaults)
  45. TOOLS_TARGET_PAIRS=
  46. AC_SUBST(TOOLS_TARGET_PAIRS)
  47. EXTRA_GNATTOOLS=
  48. AC_SUBST(EXTRA_GNATTOOLS)
  49. # Per-target case statement
  50. # -------------------------
  51. case "${target}" in
  52. *-*-aix*)
  53. TOOLS_TARGET_PAIRS="\
  54. mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
  55. indepsw.adb<indepsw-aix.adb"
  56. ;;
  57. *-*-darwin*)
  58. TOOLS_TARGET_PAIRS="\
  59. mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb \
  60. indepsw.adb<indepsw-darwin.adb"
  61. ;;
  62. *-*-dragonfly*)
  63. TOOLS_TARGET_PAIRS="\
  64. mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
  65. indepsw.adb<indepsw-gnu.adb"
  66. ;;
  67. *-*-freebsd*)
  68. TOOLS_TARGET_PAIRS="\
  69. mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
  70. indepsw.adb<indepsw-gnu.adb"
  71. ;;
  72. *-*-linux*)
  73. TOOLS_TARGET_PAIRS="\
  74. mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
  75. indepsw.adb<indepsw-gnu.adb"
  76. ;;
  77. *-*-solaris*)
  78. TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb"
  79. ;;
  80. *-*-vxworks*)
  81. TOOLS_TARGET_PAIRS="\
  82. mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
  83. indepsw.adb<indepsw-gnu.adb"
  84. ;;
  85. hppa*-hp-hpux10*)
  86. ;;
  87. hppa*-hp-hpux11*)
  88. TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb"
  89. ;;
  90. ia64-hp-hpux11*)
  91. TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-ia64-hpux.adb"
  92. ;;
  93. alpha*-*-vms* | alpha*-*-openvms*)
  94. TOOLS_TARGET_PAIRS="\
  95. mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
  96. symbols.adb<symbols-vms.adb \
  97. symbols-processing.adb<symbols-processing-vms-alpha.adb"
  98. EXTRA_GNATTOOLS='../../gnatlbr$(exeext) ../../gnatsym$(exeext)'
  99. ;;
  100. ia64-*-vms* | ia64-*-openvms*)
  101. TOOLS_TARGET_PAIRS="\
  102. mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
  103. symbols.adb<symbols-vms.adb \
  104. symbols-processing.adb<symbols-processing-vms-ia64.adb"
  105. EXTRA_GNATTOOLS='../../gnatlbr$(exeext) ../../gnatsym$(exeext)'
  106. ;;
  107. *-*-cygwin32* | *-*-mingw32* | *-*-pe)
  108. TOOLS_TARGET_PAIRS="\
  109. mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
  110. indepsw.adb<indepsw-mingw.adb"
  111. EXTRA_GNATTOOLS='../../gnatdll$(exeext)'
  112. ;;
  113. esac
  114. # From user or toplevel makefile.
  115. AC_SUBST(ADA_CFLAGS)
  116. # This is testing the CC passed from the toplevel Makefile, not the
  117. # one we will select below.
  118. AC_PROG_CC
  119. warn_cflags=
  120. if test "x$GCC" = "xyes"; then
  121. warn_cflags='$(GCC_WARN_CFLAGS)'
  122. fi
  123. AC_SUBST(warn_cflags)
  124. # Determine what to build for 'gnattools'. Test after the above,
  125. # because testing for CC sets the final value of cross_compiling, even
  126. # if we end up using a different CC. We want to build
  127. # gnattools-native when: (a) this is a native build, i.e.,
  128. # cross_compiling=no, otherwise we know we cannot run binaries
  129. # produced by the toolchain used for the build, not even the binaries
  130. # created within ../gcc/; (b) build and host are the same, otherwise
  131. # this is to be regarded as a cross build environment even if it seems
  132. # that we can run host binaries; (c) host and target are the same,
  133. # otherwise the tools in ../gcc/ generate code for a different
  134. # platform. If you change this test, be sure to adjust
  135. # ../gcc/ada/gcc-interface/config-lang.in as well.
  136. if test "x$cross_compiling/$build/$host" = "xno/$host/$target" ; then
  137. default_gnattools_target="gnattools-native"
  138. else
  139. default_gnattools_target="gnattools-cross"
  140. fi
  141. AC_SUBST([default_gnattools_target])
  142. # Output: create a Makefile.
  143. AC_CONFIG_FILES([Makefile])
  144. AC_OUTPUT