multi.m4 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ## -*- Autoconf -*-
  2. # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2008
  3. # Free Software Foundation, Inc.
  4. #
  5. # This file is free software; the Free Software Foundation
  6. # gives unlimited permission to copy and/or distribute it,
  7. # with or without modifications, as long as this notice is preserved.
  8. # serial 6
  9. # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
  10. # ---------------------------------------------------
  11. # Add --enable-multilib to configure.
  12. AC_DEFUN([AM_ENABLE_MULTILIB],
  13. [# Default to --enable-multilib
  14. AC_ARG_ENABLE(multilib,
  15. [ --enable-multilib build many library versions (default)],
  16. [case "$enableval" in
  17. yes) multilib=yes ;;
  18. no) multilib=no ;;
  19. *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
  20. esac],
  21. [multilib=yes])
  22. # We may get other options which we leave undocumented:
  23. # --with-target-subdir, --with-multisrctop, --with-multisubdir
  24. # See config-ml.in if you want the gory details.
  25. if test "$srcdir" = "."; then
  26. if test "$with_target_subdir" != "."; then
  27. multi_basedir="$srcdir/$with_multisrctop../$2"
  28. else
  29. multi_basedir="$srcdir/$with_multisrctop$2"
  30. fi
  31. else
  32. multi_basedir="$srcdir/$2"
  33. fi
  34. AC_SUBST(multi_basedir)
  35. # Even if the default multilib is not a cross compilation,
  36. # it may be that some of the other multilibs are.
  37. if test $cross_compiling = no && test $multilib = yes \
  38. && test "x${with_multisubdir}" != x ; then
  39. cross_compiling=maybe
  40. fi
  41. AC_OUTPUT_COMMANDS([
  42. # Only add multilib support code if we just rebuilt the top-level
  43. # Makefile.
  44. case " $CONFIG_FILES " in
  45. *" ]m4_default([$1],Makefile)[ "*)
  46. ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
  47. ;;
  48. esac],
  49. [
  50. srcdir="$srcdir"
  51. host="$host"
  52. target="$target"
  53. with_multisubdir="$with_multisubdir"
  54. with_multisrctop="$with_multisrctop"
  55. with_target_subdir="$with_target_subdir"
  56. ac_configure_args="${multilib_arg} ${ac_configure_args}"
  57. multi_basedir="$multi_basedir"
  58. CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  59. CC="$CC"
  60. CXX="$CXX"
  61. GFORTRAN="$GFORTRAN"
  62. GCJ="$GCJ"])])dnl