multi.m4 2.0 KB

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