summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2011-09-01 13:14:41 +0200
committerRichard Hughes <richard@hughsie.com>2011-09-01 12:21:45 +0100
commitc08c35f762323534e7da9079803f998a999fe10b (patch)
treec6ff76eb22f459195d71600c6858e0c906e16676
parent785ecbb6d5f635f7c8076009f696001d2247fd31 (diff)
build: don't rely on files' presence to define the default backend.
Files might not be there, or in the case of cross-compilation, they most definitely won't be there (and if they are, they are not the ones you should be looking for). Instead use the autoconf-defined $host variable to identify for what system we're building for. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu> Signed-off-by: Richard Hughes <richard@hughsie.com>
-rw-r--r--configure.ac15
1 files changed, 6 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 9afd298..e3f2ccb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,16 +173,13 @@ AC_ARG_WITH([backend],
AS_HELP_STRING([--with-backend=<option>],
[Default backend to use linux, freebsd, openbsd, dummy (dummy)]))
# default to a sane option
+AC_CANONICAL_HOST
if test x$with_backend = x; then
- if test -e /usr/include/gudev-1.0/gudev/gudev.h ; then
- with_backend=linux
- elif test -e /usr/include/dev/acpica/acpiio.h ; then
- with_backend=freebsd
- elif test -e /usr/include/machine/apmvar.h ; then
- with_backend=openbsd
- else
- with_backend=dummy
- fi
+ AS_CASE([$host],
+ [*-linux*], [with_backend=linux],
+ [*-freebsd*], [with_backend=freebsd],
+ [*-openbsd*], [with_backedn=openbsd],
+ [with_backend=dummy])
fi
AC_DEFINE_UNQUOTED(BACKEND, "$with_backend", [backend])
AC_SUBST(BACKEND, "$with_backend")