chiark / gitweb /
dpkg (1.18.25) stretch; urgency=medium
[dpkg] / m4 / dpkg-arch.m4
1 # Copyright © 2005 Scott James Remnant <scott@netsplit.com>
2 # Copyright © 2006-2009 Guillem Jover <guillem@debian.org>
3
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
13
14 # DPKG_CPU_TYPE
15 # -------------
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"], [
22     cpu_type=$host_cpu
23     AC_MSG_RESULT([$cpu_type])
24     AC_MSG_WARN([$host_cpu not found in cputable])
25   ], [
26     AC_MSG_RESULT([$cpu_type])
27   ])
28   AC_DEFINE_UNQUOTED([ARCHITECTURE_CPU], ["${cpu_type}"],
29     [Set this to the canonical dpkg CPU name.])
30 ])# DPKG_CPU_TYPE
31
32 # DPKG_OS_TYPE
33 # ------------
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"], [
40     os_type=$host_os
41     AC_MSG_RESULT([$os_type])
42     AC_MSG_WARN([$host_os not found in ostable])
43   ], [
44     AC_MSG_RESULT([$os_type])
45   ])
46   AC_DEFINE_UNQUOTED([ARCHITECTURE_OS], ["${os_type}"],
47     [Set this to the canonical dpkg system name.])
48 ])# DPKG_OS_TYPE
49
50 # DPKG_ARCHITECTURE
51 # ------------------------
52 # Determine the Debian name for the host operating system,
53 # sets ARCHITECTURE.
54 AC_DEFUN([DPKG_ARCHITECTURE], [
55   DPKG_CPU_TYPE
56   DPKG_OS_TYPE
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])
61   ], [
62     AC_MSG_RESULT([$dpkg_arch])
63   ])
64   AC_DEFINE_UNQUOTED([ARCHITECTURE], ["${dpkg_arch}"],
65     [Set this to the canonical dpkg architecture name.])
66 ])# DPKG_ARCHITECTURE