build/autoconf/subconfigure.m4

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 dnl We are not running in a real autoconf environment. So we're using real m4
     2 dnl here, not the crazier environment that autoconf provides.
     4 dnl Autoconf expects [] for quotes; give it to them
     5 changequote([, ])
     7 dnl AC_DEFUN is provided to use instead of define in autoconf. Provide it too.
     8 define([AC_DEFUN], [define($1, [$2])])
    10 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, IF-TRUE[, IF-FALSE])
    11 dnl We have to ignore the help string due to how help works in autoconf...
    12 AC_DEFUN([AC_ARG_ENABLE],
    13 [#] Check whether --enable-[$1] or --disable-[$1] was given.
    14 [if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
    15   enableval="[$enable_]patsubst([$1], -, _)"
    16   $3
    17 ifelse([$4], , , [else
    18   $4
    19 ])dnl
    20 fi
    21 ])
    23 dnl AC_MSG_ERROR(error-description)
    24 AC_DEFUN([AC_MSG_ERROR], [{ echo "configure: error: $1" 1>&2; exit 1; }])
    26 AC_DEFUN([AC_MSG_WARN],  [ echo "configure: warning: $1" 1>&2 ])
    28 dnl Add the variable to the list of substitution variables
    29 AC_DEFUN([AC_SUBST],
    30 [
    31 _subconfigure_ac_subst_args="$_subconfigure_ac_subst_args $1"
    32 ])
    34 dnl Override for AC_DEFINE.
    35 AC_DEFUN([AC_DEFINE],
    36 [
    37 cat >>confdefs.h <<\EOF
    38 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
    39 EOF
    40 cat >> confdefs.pytmp <<\EOF
    41     (''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 '))
    42 EOF
    43 ])
    45 dnl AC_OUTPUT_SUBDIRS(subdirectory)
    46 AC_DEFUN([AC_OUTPUT_SUBDIRS], [do_output_subdirs "$1"])

mercurial