1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/autoconf/subconfigure.m4 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +dnl We are not running in a real autoconf environment. So we're using real m4 1.5 +dnl here, not the crazier environment that autoconf provides. 1.6 + 1.7 +dnl Autoconf expects [] for quotes; give it to them 1.8 +changequote([, ]) 1.9 + 1.10 +dnl AC_DEFUN is provided to use instead of define in autoconf. Provide it too. 1.11 +define([AC_DEFUN], [define($1, [$2])]) 1.12 + 1.13 +dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, IF-TRUE[, IF-FALSE]) 1.14 +dnl We have to ignore the help string due to how help works in autoconf... 1.15 +AC_DEFUN([AC_ARG_ENABLE], 1.16 +[#] Check whether --enable-[$1] or --disable-[$1] was given. 1.17 +[if test "[${enable_]patsubst([$1], -, _)+set}" = set; then 1.18 + enableval="[$enable_]patsubst([$1], -, _)" 1.19 + $3 1.20 +ifelse([$4], , , [else 1.21 + $4 1.22 +])dnl 1.23 +fi 1.24 +]) 1.25 + 1.26 +dnl AC_MSG_ERROR(error-description) 1.27 +AC_DEFUN([AC_MSG_ERROR], [{ echo "configure: error: $1" 1>&2; exit 1; }]) 1.28 + 1.29 +AC_DEFUN([AC_MSG_WARN], [ echo "configure: warning: $1" 1>&2 ]) 1.30 + 1.31 +dnl Add the variable to the list of substitution variables 1.32 +AC_DEFUN([AC_SUBST], 1.33 +[ 1.34 +_subconfigure_ac_subst_args="$_subconfigure_ac_subst_args $1" 1.35 +]) 1.36 + 1.37 +dnl Override for AC_DEFINE. 1.38 +AC_DEFUN([AC_DEFINE], 1.39 +[ 1.40 +cat >>confdefs.h <<\EOF 1.41 +[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) 1.42 +EOF 1.43 +cat >> confdefs.pytmp <<\EOF 1.44 + (''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 ')) 1.45 +EOF 1.46 +]) 1.47 + 1.48 +dnl AC_OUTPUT_SUBDIRS(subdirectory) 1.49 +AC_DEFUN([AC_OUTPUT_SUBDIRS], [do_output_subdirs "$1"])