PageRenderTime 2505ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/attr-2.4.44/m4/multilib.m4

https://github.com/GNA-SERVICES-INC/MoNGate
m4 | 43 lines | 38 code | 1 blank | 4 comment | 0 complexity | 6ff30e4f341d9d84e7dd2e9baa3a5884 MD5 | raw file
  1. # The AC_MULTILIB macro was extracted and modified from
  2. # gettext-0.15's AC_LIB_PREPARE_MULTILIB macro in the lib-prefix.m4 file
  3. # so that the correct paths can be used for 64-bit libraries.
  4. #
  5. dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
  6. dnl This file is free software; the Free Software Foundation
  7. dnl gives unlimited permission to copy and/or distribute it,
  8. dnl with or without modifications, as long as this notice is preserved.
  9. dnl From Bruno Haible.
  10. dnl AC_MULTILIB creates a variable libdirsuffix, containing
  11. dnl the suffix of the libdir, either "" or "64".
  12. dnl Only do this if the given enable parameter is "yes".
  13. AC_DEFUN([AC_MULTILIB],
  14. [
  15. dnl There is no formal standard regarding lib and lib64. The current
  16. dnl practice is that on a system supporting 32-bit and 64-bit instruction
  17. dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
  18. dnl libraries go under $prefix/lib. We determine the compiler's default
  19. dnl mode by looking at the compiler's library search path. If at least
  20. dnl of its elements ends in /lib64 or points to a directory whose absolute
  21. dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
  22. dnl default, namely "lib".
  23. enable_lib64="$1"
  24. libdirsuffix=""
  25. searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  26. if test "$enable_lib64" = "yes" -a -n "$searchpath"; then
  27. save_IFS="${IFS= }"; IFS=":"
  28. for searchdir in $searchpath; do
  29. if test -d "$searchdir"; then
  30. case "$searchdir" in
  31. */lib64/ | */lib64 ) libdirsuffix=64 ;;
  32. *) searchdir=`cd "$searchdir" && pwd`
  33. case "$searchdir" in
  34. */lib64 ) libdirsuffix=64 ;;
  35. esac ;;
  36. esac
  37. fi
  38. done
  39. IFS="$save_IFS"
  40. fi
  41. AC_SUBST(libdirsuffix)
  42. ])