arch.m4 1.9 KB

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