mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-08 04:18:04 +02:00
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>
This commit is contained in:
parent
785ecbb6d5
commit
c08c35f762
1 changed files with 6 additions and 9 deletions
15
configure.ac
15
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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue