dpkg-arch.m4 2.2 KB

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