dpkg-arch.m4 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright © 2005 Scott James Remnant <scott@netsplit.com>
  2. # Copyright © 2006-2009 Guillem Jover <guillem@debian.org>
  3. # _DPKG_ARCHITECTURE([DEB_VAR], [sh_var])
  4. # ---------------------------------------
  5. # Use dpkg-architecture from the source tree to set sh_var using DEB_VAR for
  6. # the target architecture, to avoid duplicating its logic.
  7. AC_DEFUN([_DPKG_ARCHITECTURE], [
  8. AC_REQUIRE([DPKG_PROG_PERL])dnl
  9. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  10. $2=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -q$1 2>/dev/null)
  11. ])# _DPKG_ARCHITECURE
  12. # DPKG_CPU_TYPE
  13. # -------------
  14. # Parse the host cpu name and check it against the cputable to determine
  15. # the Debian name for it. Sets ARCHITECTURE_CPU.
  16. AC_DEFUN([DPKG_CPU_TYPE], [
  17. AC_MSG_CHECKING([dpkg cpu type])
  18. _DPKG_ARCHITECTURE([DEB_HOST_ARCH_CPU], [cpu_type])
  19. AS_IF([test "x$cpu_type" = "x"], [
  20. cpu_type=$host_cpu
  21. AC_MSG_RESULT([$cpu_type])
  22. AC_MSG_WARN([$host_cpu not found in cputable])
  23. ], [
  24. AC_MSG_RESULT([$cpu_type])
  25. ])
  26. AC_DEFINE_UNQUOTED([ARCHITECTURE_CPU], ["${cpu_type}"],
  27. [Set this to the canonical dpkg CPU name.])
  28. ])# DPKG_CPU_TYPE
  29. # DPKG_OS_TYPE
  30. # ------------
  31. # Parse the host operating system name and check it against a list of
  32. # special cases to determine what type it is. Sets ARCHITECTURE_OS.
  33. AC_DEFUN([DPKG_OS_TYPE], [
  34. AC_MSG_CHECKING([dpkg operating system type])
  35. _DPKG_ARCHITECTURE([DEB_HOST_ARCH_OS], [os_type])
  36. AS_IF([test "x$os_type" = "x"], [
  37. os_type=$host_os
  38. AC_MSG_RESULT([$os_type])
  39. AC_MSG_WARN([$host_os not found in ostable])
  40. ], [
  41. AC_MSG_RESULT([$os_type])
  42. ])
  43. AC_DEFINE_UNQUOTED([ARCHITECTURE_OS], ["${os_type}"],
  44. [Set this to the canonical dpkg system name.])
  45. ])# DPKG_OS_TYPE
  46. # DPKG_ARCHITECTURE
  47. # ------------------------
  48. # Determine the Debian name for the host operating system,
  49. # sets ARCHITECTURE.
  50. AC_DEFUN([DPKG_ARCHITECTURE], [
  51. DPKG_CPU_TYPE
  52. DPKG_OS_TYPE
  53. AC_MSG_CHECKING([dpkg architecture name])
  54. _DPKG_ARCHITECTURE([DEB_HOST_ARCH], [dpkg_arch])
  55. AS_IF([test "x$dpkg_arch" = "x"], [
  56. AC_MSG_ERROR([cannot determine host dpkg architecture])
  57. ], [
  58. AC_MSG_RESULT([$dpkg_arch])
  59. ])
  60. AC_DEFINE_UNQUOTED([ARCHITECTURE], ["${dpkg_arch}"],
  61. [Set this to the canonical dpkg architecture name.])
  62. ])# DPKG_ARCHITECTURE