arch.m4 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # DPKG_CPU_TYPE
  2. # -------------
  3. # Parse the target cpu name and check it against the cputable to determine
  4. # the Debian name for it. Sets ARCHITECTURE_CPU.
  5. AC_DEFUN([DPKG_CPU_TYPE],
  6. [AC_MSG_CHECKING([dpkg cpu type])
  7. [cpu_type="`awk \"! /^(#.*)?\\$/ { if (match(\\\"$target_cpu\\\", \\\"^\\\"\\$][3\\\"\\$\\\")) { print \\$][1; exit; } }\" $srcdir/cputable`"]
  8. if test "x$cpu_type" = "x"; then
  9. cpu_type=$target_cpu
  10. AC_MSG_RESULT([$cpu_type])
  11. AC_MSG_WARN([$target_cpu not found in cputable])
  12. else
  13. AC_MSG_RESULT([$cpu_type])
  14. fi
  15. AC_DEFINE_UNQUOTED(ARCHITECTURE_CPU, "${cpu_type}",
  16. [Set this to the canonical dpkg CPU name.])
  17. ])# DPKG_CPU_TYPE
  18. # DPKG_OS_TYPE
  19. # ------------
  20. # Parse the target operating system name and check it against a list of
  21. # special cases to determine what type it is. Sets ARCHITECTURE_OS.
  22. AC_DEFUN([DPKG_OS_TYPE],
  23. [AC_MSG_CHECKING([dpkg operating system type])
  24. [os_type="`awk \"! /^(#.*)?\\$/ { if (match(\\\"$target_os\\\", \\\"^(.*-)?\\\"\\$][3\\\"\\$\\\")) { print \\$][1; exit; } }\" $srcdir/ostable`"]
  25. if test "x$os_type" = "x"; then
  26. os_type=$target_os
  27. AC_MSG_RESULT([$os_type])
  28. AC_MSG_WARN([$target_os not found in ostable])
  29. else
  30. AC_MSG_RESULT([$os_type])
  31. fi
  32. AC_DEFINE_UNQUOTED(ARCHITECTURE_OS, "${os_type}",
  33. [Set this to the canonical dpkg system name.])
  34. ])# DPKG_OS_TYPE
  35. # DPKG_ARCHITECTURE
  36. # ------------------------
  37. # Determine the Debian name for the target operating system,
  38. # sets ARCHITECTURE.
  39. AC_DEFUN([DPKG_ARCHITECTURE],
  40. [DPKG_CPU_TYPE
  41. DPKG_OS_TYPE
  42. AC_MSG_CHECKING([dpkg architecture name])
  43. if test "x$os_type" = "xlinux"; then
  44. dpkg_arch=$cpu_type
  45. else
  46. dpkg_arch="$os_type-$cpu_type"
  47. fi
  48. AC_MSG_RESULT([$dpkg_arch])
  49. AC_DEFINE_UNQUOTED(ARCHITECTURE, "${dpkg_arch}",
  50. [Set this to the canonical dpkg architecture name.])
  51. ])# DPKG_ARCHITECTURE