arch.m4 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # _DPKG_ARCHITECTURE([DEB_VAR], [sh_var])
  2. # ---------------------------------------
  3. # Use dpkg-architecture from the source tree to set sh_var using DEB_VAR for
  4. # the target architecture, to avoid duplicating its logic.
  5. AC_DEFUN([_DPKG_ARCHITECTURE], [
  6. AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
  7. $2=`cd $srcdir/scripts; \
  8. PERL5LIB=$(pwd) ./dpkg-architecture.pl -t$target -q$1 2>/dev/null`
  9. ])# _DPKG_ARCHITECURE
  10. # DPKG_CPU_TYPE
  11. # -------------
  12. # Parse the target cpu name and check it against the cputable to determine
  13. # the Debian name for it. Sets ARCHITECTURE_CPU.
  14. AC_DEFUN([DPKG_CPU_TYPE],
  15. [AC_MSG_CHECKING([dpkg cpu type])
  16. _DPKG_ARCHITECTURE([DEB_HOST_ARCH_CPU], [cpu_type])
  17. if test "x$cpu_type" = "x"; then
  18. cpu_type=$target_cpu
  19. AC_MSG_RESULT([$cpu_type])
  20. AC_MSG_WARN([$target_cpu not found in cputable])
  21. else
  22. AC_MSG_RESULT([$cpu_type])
  23. fi
  24. AC_DEFINE_UNQUOTED(ARCHITECTURE_CPU, "${cpu_type}",
  25. [Set this to the canonical dpkg CPU name.])
  26. ])# DPKG_CPU_TYPE
  27. # DPKG_OS_TYPE
  28. # ------------
  29. # Parse the target operating system name and check it against a list of
  30. # special cases to determine what type it is. Sets ARCHITECTURE_OS.
  31. AC_DEFUN([DPKG_OS_TYPE],
  32. [AC_MSG_CHECKING([dpkg operating system type])
  33. _DPKG_ARCHITECTURE([DEB_HOST_ARCH_OS], [os_type])
  34. if test "x$os_type" = "x"; then
  35. os_type=$target_os
  36. AC_MSG_RESULT([$os_type])
  37. AC_MSG_WARN([$target_os not found in ostable])
  38. else
  39. AC_MSG_RESULT([$os_type])
  40. fi
  41. AC_DEFINE_UNQUOTED(ARCHITECTURE_OS, "${os_type}",
  42. [Set this to the canonical dpkg system name.])
  43. ])# DPKG_OS_TYPE
  44. # DPKG_ARCHITECTURE
  45. # ------------------------
  46. # Determine the Debian name for the target operating system,
  47. # sets ARCHITECTURE.
  48. AC_DEFUN([DPKG_ARCHITECTURE],
  49. [DPKG_CPU_TYPE
  50. DPKG_OS_TYPE
  51. AC_MSG_CHECKING([dpkg architecture name])
  52. _DPKG_ARCHITECTURE([DEB_HOST_ARCH], [dpkg_arch])
  53. AC_MSG_RESULT([$dpkg_arch])
  54. AC_DEFINE_UNQUOTED(ARCHITECTURE, "${dpkg_arch}",
  55. [Set this to the canonical dpkg architecture name.])
  56. ])# DPKG_ARCHITECTURE