I am creating an android.m4 file to easily look up path to programs in the android SDK/NDK.
The android.m4 file contains an helper function called _android_path_found_notfound
:
# _android_path_found_notfound(variable, program, path, found, notfound)
#
# search for a program in path. If found, 'variable' is set to the absolute path,
# then executes 'found', otherwise, 'variable' is set to '' and 'notfound' is run
m4_define([_android_path_found_notfound],
[AC_PATH_PROG([_android_temp_],[$2],[_android_notfound],[$3])
AS_IF( [test x"$_android_temp_" = x"_android_notfound"],
[$1=""
AC_SUBST([$1],[])
$5],
[$1="$_android_temp_"
AC_SUBST([$1],[$_android_temp_])
$4] )])
and many functions which use that helper function:
AC_DEFUN([AC_PROG_ANDROID],
[_android_path_found_notfound([ANDROID],[android],[$ANDROID_HOME:$PATH],[$1],[$2])]
)
AC_DEFUN([AC_PROG_DX],
[_android_path_found_notfound([DX],[dx],[$ANDROID_HOME:$PATH],[$1],[$2])]
)
...
However, when I run a configure script that calls AC_PROG_ANDROID
then AC_PROG_DX
, I obtain this:
checking for android... /opt/android-sdk-update-manager/tools/android
checking for dx... (cached) /opt/android-sdk-update-manager/tools/android
The second line points to the same program as the first one, and reads (cached). Why is the result cached?
AC_
are reserved, so it was a bad choice. – qdii