Skip to content

Commit

Permalink
Surround AC_CHECK_FILE macros in configure.ac with crosscompile checking
Browse files Browse the repository at this point in the history
When cross-compiling, AC_CHECK_FILE macro is not supported by autotools.
Falling back to default in that case.
  • Loading branch information
mobrembski authored and Michał Obrembski committed Jan 18, 2021
1 parent 6b8f9fe commit 0353e0b
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -320,26 +320,30 @@ AS_IF([test "x$enable_proc" = "x"], [
# check for ppp if not specified
AC_PATH_PROG(PPP, [ppp], [/usr/sbin/ppp], "$PATH:/sbin:/usr/sbin")
AS_IF([test "x$PPP_PATH" = "x"], [
AC_CHECK_FILE([$PPP], [
AS_IF([test "x$PPP_PATH" = "x"], [
PPP_PATH="$PPP"
])
AS_IF([test "x$with_ppp" = "x"], [
with_ppp="yes"
])
],[])
if test "$cross_compiling" != "yes"; then
AC_CHECK_FILE([$PPP], [
AS_IF([test "x$PPP_PATH" = "x"], [
PPP_PATH="$PPP"
])
AS_IF([test "x$with_ppp" = "x"], [
with_ppp="yes"
])
],[])
fi
])
# check for pppd if not specified
AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], "$PATH:/sbin:/usr/sbin")
AS_IF([test "x$PPP_PATH" = "x"], [
AC_CHECK_FILE([$PPPD], [
AS_IF([test "x$PPP_PATH" = "x"], [
PPP_PATH="$PPPD"
])
AS_IF([test "x$with_pppd" = "x"], [
with_pppd="yes"
])
],[])
if test "$cross_compiling" != "yes"; then
AC_CHECK_FILE([$PPPD], [
AS_IF([test "x$PPP_PATH" = "x"], [
PPP_PATH="$PPPD"
])
AS_IF([test "x$with_pppd" = "x"], [
with_pppd="yes"
])
],[])
fi
])
# when neither ppp nor pppd are enabled fall back to a sensible choice for the platform
AS_IF([test "x$with_ppp" = "x" -a "x$with_pppd" = "x"], [
Expand Down

0 comments on commit 0353e0b

Please sign in to comment.