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