Hi,
I'm facing a problem in my configure script generated
by autoconf 2.57.
It appears that variable $ac_config_sub is used before
assigned. This is what I get:
$ fgrep -n ac_config_sub configure
1191:$ac_config_sub sun4 >/dev/null 2>&1 ||
1192: { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
1193:echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1208:ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1209: { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
1210:echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
1245:ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1256:ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1257: { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1258:echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
Perhaps my configure.ac script is kind of exotic:
---- configure.ac -----------
AC_DEFUN(MY_INIT,[
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST
])dnl# <MC_INIT>
AC_INIT(hello)
# call my macro
MY_INIT()
AC_OUTPUT([Makefile])
-----------------------------
If I rewrite my configure.ac input to read
---- configure.ac -----------
C_DEFUN(MY_INIT,[
AC_CANONICAL_HOST
])dnl# <MC_INIT>
AC_INIT(hello)
AC_CONFIG_AUX_DIR(config)
MY_INIT()
AC_OUTPUT([Makefile])
-----------------------------
then everything works fine.
I wonder whether this problem is well known? Is it a
problem after all or is it a requirement that
AC_CONFIG_AUX_DIR
isn't allowed within user defined macros? If so, is
there are specific reason? Are there other macros with
same requirement?
Please note that my exotic code worked fine with
autoconf 2.13.
Thanks for any feedback,
Wolfi.