diff -Nru mxml-3.2/CHANGES.md mxml-3.3/CHANGES.md --- mxml-3.2/CHANGES.md 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/CHANGES.md 2021-11-09 13:48:36.000000000 +0000 @@ -1,3 +1,14 @@ +# Changes in Mini-XML 3.3 + +- Cleaned up usage of `free` throughout the library (Issue #276) +- Added more error handling to the library (Issue #277) +- Fixed potential memory leak in `mxmlLoad*` functions (Issue #278, Issue #279) +- Fixed `mxmlSaveString` with a buffer size of 0 (Issue #284) +- Fixed `MXML_MINOR_VERSION` value in "mxml.h" (Issue #285) +- Fixed POSIX threading support for MingW (Issue #287) +- Fixed some minor memory leaks found by Coverity. + + # Changes in Mini-XML 3.2 - Added support for shared libraries on Haiku (Issue #262) diff -Nru mxml-3.2/config.h.in mxml-3.3/config.h.in --- mxml-3.2/config.h.in 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/config.h.in 2021-11-09 13:48:36.000000000 +0000 @@ -38,7 +38,7 @@ * Long long support... */ -#undef HAVE_LONG_LONG +#undef HAVE_LONG_LONG_INT /* diff -Nru mxml-3.2/configure mxml-3.3/configure --- mxml-3.2/configure 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/configure 2021-11-09 13:48:36.000000000 +0000 @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Mini-XML 3.2. +# Generated by GNU Autoconf 2.71 for Mini-XML 3.3. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,42 +169,52 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,14 +222,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -255,18 +254,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://github.com/michaelrsweet/mxml/issues about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run @@ -294,6 +294,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -311,6 +312,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -325,7 +334,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -334,7 +343,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -373,12 +382,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -390,18 +400,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -413,9 +432,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -442,7 +461,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -486,7 +505,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -500,6 +519,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -513,6 +536,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -580,61 +610,53 @@ # Identity of this package. PACKAGE_NAME='Mini-XML' PACKAGE_TARNAME='mxml' -PACKAGE_VERSION='3.2' -PACKAGE_STRING='Mini-XML 3.2' +PACKAGE_VERSION='3.3' +PACKAGE_STRING='Mini-XML 3.3' PACKAGE_BUGREPORT='https://github.com/michaelrsweet/mxml/issues' -PACKAGE_URL='https://michaelrsweet.github.io/mxml' +PACKAGE_URL='https://www.msweet.org/mxml' # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS PC_LIBS PC_CFLAGS TARGETS +WARNINGS PICFLAG LIBMXML DSOFLAGS DSO -PTHREAD_LIBS -PTHREAD_FLAGS -EGREP -GREP -CPP ARFLAGS RM MKDIR @@ -686,6 +708,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -712,6 +735,8 @@ with_archflags with_optim enable_debug +enable_maintainer +enable_sanitizer with_docdir with_vsnprintf enable_threads @@ -727,8 +752,7 @@ CPPFLAGS CXX CXXFLAGS -CCC -CPP' +CCC' # Initialize some variables set by options. @@ -767,6 +791,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -796,8 +821,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -838,9 +861,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -864,9 +887,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1019,6 +1042,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1068,9 +1100,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1084,9 +1116,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1130,9 +1162,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1148,7 +1180,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1156,7 +1188,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1212,7 +1244,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1269,7 +1301,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Mini-XML 3.2 to adapt to many kinds of systems. +\`configure' configures Mini-XML 3.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,6 +1341,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1334,7 +1367,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Mini-XML 3.2:";; + short | recursive ) echo "Configuration of Mini-XML 3.3:";; esac cat <<\_ACEOF @@ -1343,8 +1376,10 @@ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug turn on debugging, default=no - --enable-threads enable multi-threading support - --enable-shared turn on shared libraries, default=no + --enable-maintainer turn on maintainer mode, default=no + --enable-sanitizer build with AddressSanitizer, default=no + --disable-threads disable multi-threading support, default=no + --disable-shared turn off shared libraries, default=no Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1352,7 +1387,8 @@ --with-ansi set full ANSI C mode, default=no --with-archflags set additional architecture flags, default=none --with-optim set additional optimization flags, default=none - --with-docdir set directory for documentation, default=${prefix}/share/doc/mxml + --with-docdir set directory for documentation, + default=${prefix}/share/doc/mxml --with-vsnprintf use vsnprintf emulation functions, default=auto Some influential environment variables: @@ -1365,13 +1401,12 @@ you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . -Mini-XML home page: . +Mini-XML home page: . _ACEOF ac_status=$? fi @@ -1387,9 +1422,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1417,7 +1452,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1425,7 +1461,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1434,10 +1470,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Mini-XML configure 3.2 -generated by GNU Autoconf 2.69 +Mini-XML configure 3.3 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1454,14 +1490,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1469,14 +1505,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1492,14 +1529,14 @@ ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1507,14 +1544,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1530,14 +1568,14 @@ ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1545,17 +1583,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1576,11 +1615,12 @@ ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1588,16 +1628,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1615,160 +1648,33 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------------------------- ## -## Report this to https://github.com/michaelrsweet/mxml/issues ## -## ----------------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1778,25 +1684,26 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -1814,37 +1721,59 @@ ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Mini-XML $as_me 3.2, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by Mini-XML $as_me 3.3, which was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -1877,8 +1806,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -1913,7 +1846,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -1948,11 +1881,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -1963,8 +1898,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -1988,7 +1923,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -1996,14 +1931,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2011,15 +1946,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2027,8 +1962,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2042,63 +1977,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2108,139 +2028,748 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2259,21 +2788,22 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2296,78 +2826,126 @@ host_os_name=`echo $host_os | sed -e '1,$s/[0-9.]*$//g'` host_os_version=`echo $host_os | sed -e '1,$s/^[^0-9.]*//g'` + ac_config_headers="$ac_config_headers config.h" -VERSION="3.2" -cat >>confdefs.h <<_ACEOF -#define MXML_VERSION "Mini-XML v$VERSION" -_ACEOF +VERSION="3.3" + +printf "%s\n" "#define MXML_VERSION \"Mini-XML v$VERSION\"" >>confdefs.h + CFLAGS="${CFLAGS:=}" -CXXFLAGS="${CXXFLAGS:=}" +CPPFLAGS="${CPPFLAGS:=}" LDFLAGS="${LDFLAGS:=}" +LIBS="${LIBS:=}" + # Check whether --with-ansi was given. -if test "${with_ansi+set}" = set; then : - withval=$with_ansi; use_ansi="$withval" -else - use_ansi="no" +if test ${with_ansi+y} +then : + withval=$with_ansi; + use_ansi="$withval" + +else $as_nop + + use_ansi="no" + fi # Check whether --with-archflags was given. -if test "${with_archflags+set}" = set; then : - withval=$with_archflags; ARCHFLAGS="$withval" -else - ARCHFLAGS="" +if test ${with_archflags+y} +then : + withval=$with_archflags; + ARCHFLAGS="$withval" + +else $as_nop + + ARCHFLAGS="" + fi # Check whether --with-optim was given. -if test "${with_optim+set}" = set; then : - withval=$with_optim; OPTIM="$withval" -else - OPTIM="" +if test ${with_optim+y} +then : + withval=$with_optim; + OPTIM="$withval" + +else $as_nop + + OPTIM="" + fi # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; if eval "test x$enable_debug = xyes"; then - OPTIM="$OPTIM -g" +if test ${enable_debug+y} +then : + enableval=$enable_debug; fi + +# Check whether --enable-maintainer was given. +if test ${enable_maintainer+y} +then : + enableval=$enable_maintainer; +fi + +# Check whether --enable-sanitizer was given. +if test ${enable_sanitizer+y} +then : + enableval=$enable_sanitizer; fi # Check whether --with-docdir was given. -if test "${with_docdir+set}" = set; then : - withval=$with_docdir; docdir="$withval" -else - docdir="NONE" -fi +if test ${with_docdir+y} +then : + withval=$with_docdir; + docdir="$withval" + +else $as_nop + docdir="NONE" + +fi # Check whether --with-vsnprintf was given. -if test "${with_vsnprintf+set}" = set; then : - withval=$with_vsnprintf; use_vsnprintf="$withval" -else - use_vsnprintf="no" +if test ${with_vsnprintf+y} +then : + withval=$with_vsnprintf; + use_vsnprintf="$withval" + +else $as_nop + + use_vsnprintf="no" + fi + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2376,11 +2954,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2388,11 +2967,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2403,11 +2986,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2416,11 +2999,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2428,11 +3012,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2443,11 +3031,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2455,8 +3043,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2469,11 +3057,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2481,11 +3070,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2496,11 +3089,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2509,11 +3102,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2522,15 +3116,19 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2546,33 +3144,144 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC fi fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -2580,11 +3289,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2595,28 +3308,25 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$CC" && break - done fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -2624,11 +3334,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2639,50 +3353,48 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - - test -n "$ac_ct_CC" && break -done - if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2692,7 +3404,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -2700,7 +3412,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -2712,9 +3424,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -2735,11 +3447,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2756,7 +3469,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2772,44 +3485,46 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2823,15 +3538,15 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -2840,7 +3555,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -2852,8 +3567,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -2861,10 +3576,10 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -2872,39 +3587,40 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2918,11 +3634,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2931,31 +3648,32 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -2965,29 +3683,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -2996,57 +3718,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3061,94 +3786,144 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -3157,6 +3932,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3167,15 +3948,16 @@ CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -3183,11 +3965,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3198,11 +3984,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3211,15 +3997,16 @@ fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -3227,11 +4014,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3242,11 +4033,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3258,8 +4049,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -3269,7 +4060,7 @@ fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -3279,7 +4070,7 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3289,20 +4080,21 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3312,29 +4104,33 @@ return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -3343,57 +4139,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -3408,13 +4207,108 @@ CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -3428,20 +4322,25 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -3451,13 +4350,13 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -3465,12 +4364,12 @@ echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -3486,7 +4385,7 @@ rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -3496,8 +4395,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -3507,18 +4406,22 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -if test "$INSTALL" = "$ac_install_sh"; then - # Use full path to install-sh script... - INSTALL="`pwd`/install-sh -c" +if test "$INSTALL" = "$ac_install_sh" +then : + + # Use full path to install-sh script... + INSTALL="`pwd`/install-sh -c" + fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -3526,11 +4429,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3541,11 +4448,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3554,11 +4461,12 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -3566,11 +4474,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3581,11 +4493,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -3593,8 +4505,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -3606,11 +4518,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -3618,11 +4531,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3633,11 +4550,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3646,11 +4563,12 @@ ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -3658,11 +4576,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3673,11 +4595,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AR" = x; then @@ -3685,8 +4607,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -3697,11 +4619,12 @@ # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CP+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. @@ -3711,11 +4634,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CP="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3727,11 +4654,11 @@ fi CP=$ac_cv_path_CP if test -n "$CP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 -$as_echo "$CP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 +printf "%s\n" "$CP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3739,11 +4666,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LDCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LDCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $LDCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDCONFIG="$LDCONFIG" # Let the user override the test with a path. @@ -3753,11 +4681,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LDCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LDCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3769,11 +4701,11 @@ fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5 -$as_echo "$LDCONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5 +printf "%s\n" "$LDCONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3782,11 +4714,12 @@ # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LN+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $LN in [\\/]* | ?:[\\/]*) ac_cv_path_LN="$LN" # Let the user override the test with a path. @@ -3796,11 +4729,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3812,21 +4749,22 @@ fi LN=$ac_cv_path_LN if test -n "$LN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 -$as_echo "$LN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LN" >&5 +printf "%s\n" "$LN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MKDIR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MKDIR+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MKDIR in [\\/]* | ?:[\\/]*) ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. @@ -3836,11 +4774,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_MKDIR="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3852,21 +4794,22 @@ fi MKDIR=$ac_cv_path_MKDIR if test -n "$MKDIR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 -$as_echo "$MKDIR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 +printf "%s\n" "$MKDIR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_RM+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. @@ -3876,11 +4819,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_RM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3892,53 +4839,60 @@ fi RM=$ac_cv_path_RM if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 +printf "%s\n" "$RM" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -case "$host_os_name" in - darwin* | *bsd) - ARFLAGS="-rcv" - ;; - *) - ARFLAGS="crvs" - ;; + +case "$host_os_name" in #( + darwin* | *bsd) : + + ARFLAGS="-rcv" + ;; #( + *) : + + ARFLAGS="crvs" + ;; #( + *) : + ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -3956,715 +4910,605 @@ esac -if test "x$use_ansi" != xyes; then - for ac_func in strdup strlcat strlcpy -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + +if test "x$use_ansi" != xyes +then : + + ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +if test "x$ac_cv_func_strdup" = xyes +then : + printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" +if test "x$ac_cv_func_strlcat" = xyes +then : + printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" +if test "x$ac_cv_func_strlcpy" = xyes +then : + printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h fi -if test "x$use_vsnprintf" != xyes; then - for ac_func in snprintf vasprintf vsnprintf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF fi -done + +if test "x$use_vsnprintf" != xyes +then : + + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 -$as_echo_n "checking for long long int... " >&6; } -if ${ac_cv_c_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$GCC" = yes; then - ac_cv_c_long_long=yes - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi +ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes +then : + printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h + +fi + + +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_unsigned_long_long_int=yes + case $ac_prog_cc_stdc in + no | c89) ;; + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int -main () +main (void) { -long long int i; +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_long_long=yes -else - ac_cv_c_long_long=no +if ac_fn_c_try_link "$LINENO" +then : + +else $as_nop + ac_cv_type_unsigned_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext;; + esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then + +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_long_long_int=yes + case $ac_prog_cc_stdc in + no | c89) ;; + *) + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main (void) +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +else $as_nop + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi;; + esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + +# Check whether --enable-threads was given. +if test ${enable_threads+y} +then : + enableval=$enable_threads; fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_long_long" >&5 -$as_echo "$ac_cv_c_long_long" >&6; } -if test $ac_cv_c_long_long = yes; then - $as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h + +have_pthread=no +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi +if test "x$enable_threads" != xno +then : + + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + + printf "%s\n" "#define HAVE_PTHREAD_H Have ?" >>confdefs.h + -# Check whether --enable-threads was given. -if test "${enable_threads+set}" = set; then : - enableval=$enable_threads; fi -have_pthread=no -PTHREAD_FLAGS="" -PTHREAD_LIBS="" + if test x$ac_cv_header_pthread_h = xyes +then : -if test "x$enable_threads" != xno; then - ac_ext=c + for flag in -lpthreads -lpthread -pthread; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create using $flag" >&5 +printf %s "checking for pthread_create using $flag... " >&6; } + SAVELIBS="$LIBS" + LIBS="$flag $LIBS" + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error +#include +int +main (void) +{ +pthread_create(0, 0, 0, 0); + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext + have_pthread=yes - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext +else $as_nop + + LIBS="$SAVELIBS" -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext - done - ac_cv_prog_CPP=$CPP + if test x$have_pthread = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT" + break + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + done -else - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +DSO="${DSO:=:}" +DSOFLAGS="${DSOFLAGS:=}" + +# Check whether --enable-shared was given. +if test ${enable_shared+y} +then : + enableval=$enable_shared; fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test x$enable_shared != xno +then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library support" >&5 +printf %s "checking for shared library support... " >&6; } + PICFLAG=1 + + case "$host_os_name" in #( + sunos | unix_s) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" + LDFLAGS="$LDFLAGS -R\$(libdir)" + ;; #( + linux*) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1 -shared \$(OPTIM)" + ;; #( + osf | gnu) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" + LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" + ;; #( + *bsd | haiku*) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" + LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" + ;; #( + darwin) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LIBMXML="libmxml.1.dylib" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -lc" + ;; #( + mingw) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + LIBMXML="mxml1.dll" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -shared -Wl,--out-implib,libmxml1.a,--no-undefined,--enable-runtime-pseudo-reloc" + ;; #( + *) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: shared libraries not supported on this platform." >&5 +printf "%s\n" "$as_me: WARNING: shared libraries not supported on this platform." >&2;} + PICFLAG=0 + LIBMXML="libmxml.a" + ;; #( + *) : + ;; esac - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi +else $as_nop + + PICFLAG=0 + LIBMXML="libmxml.a" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ +WARNINGS="" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +if test -n "$GCC" +then : -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : + CFLAGS="-D_GNU_SOURCE $CFLAGS" + + if test "x$OPTIM" = x +then : + + if test x$enable_debug = xyes +then : + + OPTIM="-g" + +else $as_nop + + OPTIM="-g -Os" -else - ac_cv_header_stdc=no fi -rm -f conftest* + +elif test x$enable_debug = xyes +then : + + OPTIM="$OPTIM -g" fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + if test x$enable_sanitizer = xyes +then : -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + # Use -fsanitize=address with debugging... + OPTIM="$OPTIM -fsanitize=address" + +else $as_nop + + # Otherwise use the Fortify enhancements to catch any unbounded + # string operations... + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" -else - ac_cv_header_stdc=no fi -rm -f conftest* + + if test "x$use_ansi" = xyes +then : + + CFLAGS="-ansi -pedantic $CFLAGS" fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + WARNINGS="-Wall -Wunused" + + for warning in char-subscripts format-truncation format-y2k switch unused-result; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-$warning" >&5 +printf %s "checking whether compiler supports -Wno-$warning... " >&6; } + + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wno-$warning -Werror" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int -main () +main (void) { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; + + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + WARNINGS="$WARNINGS -Wno-$warning" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + CFLAGS="$OLDCFLAGS" + done + + if test x$enable_maintainer = xyes +then : + + WARNINGS="$WARNINGS -Werror" fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test $PICFLAG = 1 -a "$host_os_name" != aix +then : + + OPTIM="-fPIC $OPTIM" fi -done +else $as_nop + if test "x$OPTIM" = x +then : -ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - $as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h + if test x$enable_debug = xyes +then : -fi + OPTIM="-g" +else $as_nop + OPTIM="-O" - if test x$ac_cv_header_pthread_h = xyes; then - for flag in -lpthreads -lpthread -pthread; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create using $flag" >&5 -$as_echo_n "checking for pthread_create using $flag... " >&6; } - SAVELIBS="$LIBS" - LIBS="$flag $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -pthread_create(0, 0, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_pthread=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread" >&5 -$as_echo "$have_pthread" >&6; } - LIBS="$SAVELIBS" - - if test $have_pthread = yes; then - PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT" - PTHREAD_LIBS="$flag" - - # Solaris requires -D_POSIX_PTHREAD_SEMANTICS to - # be POSIX-compliant... :( - case "$host_os_name" in - sunos) - PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - break - fi - done - fi + fi + case "$host_os_name" in #( + hp-ux) : + CFLAGS="-Ae $CFLAGS" + OPTIM="+DAportable $OPTIM" -DSO="${DSO:=:}" -DSOFLAGS="${DSOFLAGS:=}" + if test $PICFLAG = 1 +then : + + OPTIM="+z $OPTIM" -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; fi + ;; #( + unix_svr | sunos) : + if test $PICFLAG = 1 +then : + + OPTIM="-KPIC $OPTIM" -if test x$enable_shared != xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library support" >&5 -$as_echo_n "checking for shared library support... " >&6; } - PICFLAG=1 - - case "$host_os_name" in - sunos | unix_s) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" - LDFLAGS="$LDFLAGS -R\$(libdir)" - ;; - - linux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1 -shared \$(OPTIM)" - ;; - - osf | gnu) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" - LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" - ;; - - *bsd | haiku*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" - LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" - ;; - - darwin) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBMXML="libmxml.1.dylib" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -lc" - ;; - - mingw) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBMXML="mxml1.dll" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -shared -Wl,--out-implib,libmxml1.a,--no-undefined,--enable-runtime-pseudo-reloc" - ;; - - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: shared libraries not supported on this platform." >&5 -$as_echo "$as_me: WARNING: shared libraries not supported on this platform." >&2;} - PICFLAG=0 - LIBMXML="libmxml.a" - ;; - esac -else - PICFLAG=0 - LIBMXML="libmxml.a" fi + ;; #( + *) : + ;; +esac +fi +if test "$build" = "$host" +then : + TARGETS="ALLTARGETS" +else $as_nop -if test -n "$GCC"; then - CFLAGS="-Wall -D_GNU_SOURCE $CFLAGS" + TARGETS="CROSSTARGETS" - if test "x$OPTIM" = x; then - OPTIM="-Os -g" - fi +fi - if test "x$use_ansi" = xyes; then - CFLAGS="-ansi -pedantic $CFLAGS" - fi - if test $PICFLAG = 1 -a "$host_os_name" != aix; then - OPTIM="-fPIC $OPTIM" - fi -else - case "$host_os_name" in - hp-ux) - CFLAGS="-Ae $CFLAGS" - - if test "x$OPTIM" = x; then - OPTIM="-O" - fi - - OPTIM="+DAportable $OPTIM" - - if test $PICFLAG = 1; then - OPTIM="+z $OPTIM" - fi - ;; - - unix_svr | sunos) - if test "x$OPTIM" = x; then - OPTIM="-O" - fi - - if test $PICFLAG = 1; then - OPTIM="-KPIC $OPTIM" - fi - ;; - - *) - if test "x$OPTIM" = x; then - OPTIM="-O" - fi - ;; - esac -fi -if test "$build" = "$host"; then - TARGETS="ALLTARGETS" -else - TARGETS="CROSSTARGETS" -fi +if test "$prefix" = "NONE" +then : + prefix="/usr/local" -if test "$prefix" = "NONE"; then - prefix="/usr/local" fi -if test "$exec_prefix" = "NONE"; then - exec_prefix="$prefix" -fi +if test "$exec_prefix" = "NONE" +then : + + exec_prefix="$prefix" -if test "$docdir" = "NONE"; then - docdir="$datadir/doc/mxml" fi -if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then - case "$host_os_name" in - *bsd | darwin | linux*) - # *BSD, Darwin (macOS), and Linux - mandir="/usr/share/man" - ;; - irix) - # SGI IRIX - mandir="/usr/share/catman/u_man" - ;; - *) - # All others - mandir="/usr/man" - ;; - esac +if test "$docdir" = "NONE" +then : + + docdir="$datadir/doc/mxml" + fi -if test "$includedir" != /usr/include; then - PC_CFLAGS="-I$includedir" -else - PC_CFLAGS="" +if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr" +then : + + mandir="/usr/share/man" + fi -if test "$libdir" != /usr/lib; then - PC_LIBS="-L$libdir -lmxml" -else - PC_LIBS="-lmxml" + +if test "$includedir" != /usr/include +then : + + PC_CFLAGS="-I$includedir" + +else $as_nop + + PC_CFLAGS="" + fi +if test "$libdir" != /usr/lib +then : + + PC_LIBS="-L$libdir -lmxml" + +else $as_nop + + PC_LIBS="-lmxml" + +fi + ac_config_files="$ac_config_files Makefile mxml.pc" @@ -4696,8 +5540,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -4727,15 +5571,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -4749,8 +5593,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -4767,7 +5611,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -4783,8 +5627,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -4807,14 +5651,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -4824,46 +5670,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -4872,13 +5718,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -4887,8 +5726,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -4900,30 +5743,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -4936,13 +5759,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -4969,18 +5793,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -4992,12 +5818,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -5028,7 +5855,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -5050,6 +5877,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -5063,6 +5894,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -5104,7 +5941,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -5113,7 +5950,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -5175,8 +6012,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Mini-XML $as_me 3.2, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by Mini-XML $as_me 3.3, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5232,17 +6069,19 @@ $config_headers Report bugs to . -Mini-XML home page: ." +Mini-XML home page: ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -Mini-XML config.status 3.2 -configured by $0, generated by GNU Autoconf 2.69, +Mini-XML config.status 3.3 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5280,15 +6119,15 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -5296,7 +6135,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -5305,7 +6144,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -5333,7 +6172,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -5347,7 +6186,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -5374,8 +6213,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -5711,7 +6550,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -5719,17 +6558,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -5746,7 +6585,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -5770,9 +6609,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -5829,8 +6668,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -5873,9 +6712,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -5891,20 +6730,20 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -5945,7 +6784,8 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + diff -Nru mxml-3.2/configure.ac mxml-3.3/configure.ac --- mxml-3.2/configure.ac 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/configure.ac 2021-11-09 13:48:36.000000000 +0000 @@ -1,22 +1,28 @@ dnl -dnl Configuration script for Mini-XML, a small XML-like file parsing library. +dnl Configuration script for Mini-XML, a small XML file parsing library. dnl dnl https://www.msweet.org/mxml dnl -dnl Copyright © 2003-2020 by Michael R Sweet. +dnl Copyright © 2003-2021 by Michael R Sweet. dnl dnl Licensed under Apache License v2.0. See the file "LICENSE" for more dnl information. dnl +dnl We need at least autoconf 2.70 for --runstatedir... +AC_PREREQ([2.70]) + + dnl Package name and version... -AC_INIT([Mini-XML], [3.2], [https://github.com/michaelrsweet/mxml/issues], [mxml], [https://michaelrsweet.github.io/mxml]) +AC_INIT([Mini-XML], [3.3], [https://github.com/michaelrsweet/mxml/issues], [mxml], [https://www.msweet.org/mxml]) + dnl This line is provided to ensure that you don't run the autoheader program dnl against this project. Doing so is completely unsupported and WILL cause dnl problems! AH_TOP([#error "Somebody ran autoheader on this project which is unsupported and WILL cause problems."]) + dnl Get the build and host platforms and split the host_os value AC_CANONICAL_BUILD AC_CANONICAL_HOST @@ -24,58 +30,73 @@ [host_os_name=`echo $host_os | sed -e '1,$s/[0-9.]*$//g'`] [host_os_version=`echo $host_os | sed -e '1,$s/^[^0-9.]*//g'`] + dnl Set the name of the config header file... -AC_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS([config.h]) + dnl Version number... VERSION="AC_PACKAGE_VERSION" AC_SUBST(VERSION) AC_DEFINE_UNQUOTED(MXML_VERSION, "Mini-XML v$VERSION") + dnl Clear default debugging options and set normal optimization by dnl default unless the user asks for debugging specifically. CFLAGS="${CFLAGS:=}" -CXXFLAGS="${CXXFLAGS:=}" +CPPFLAGS="${CPPFLAGS:=}" LDFLAGS="${LDFLAGS:=}" -AC_SUBST(LDFLAGS) +AC_SUBST([LDFLAGS]) +LIBS="${LIBS:=}" -AC_ARG_WITH(ansi, [ --with-ansi set full ANSI C mode, default=no], - use_ansi="$withval", - use_ansi="no") - -AC_ARG_WITH(archflags, [ --with-archflags set additional architecture flags, default=none], - ARCHFLAGS="$withval", - ARCHFLAGS="") -AC_SUBST(ARCHFLAGS) - -AC_ARG_WITH(optim, [ --with-optim set additional optimization flags, default=none], - OPTIM="$withval", - OPTIM="") -AC_SUBST(OPTIM) - -AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no], -if eval "test x$enable_debug = xyes"; then - OPTIM="$OPTIM -g" -fi) - -AC_ARG_WITH(docdir, [ --with-docdir set directory for documentation, default=${prefix}/share/doc/mxml], - docdir="$withval", - docdir="NONE") +dnl Options... +AC_ARG_WITH([ansi], AS_HELP_STRING([--with-ansi], [set full ANSI C mode, default=no]), [ + use_ansi="$withval" +], [ + use_ansi="no" +]) + +AC_ARG_WITH([archflags], AS_HELP_STRING([--with-archflags], [set additional architecture flags, default=none]), [ + ARCHFLAGS="$withval" +], [ + ARCHFLAGS="" +]) +AC_SUBST([ARCHFLAGS]) + +AC_ARG_WITH([optim], AS_HELP_STRING([--with-optim], [set additional optimization flags, default=none]), [ + OPTIM="$withval" +], [ + OPTIM="" +]) +AC_SUBST([OPTIM]) + +AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [turn on debugging, default=no])) +AC_ARG_ENABLE([maintainer], AS_HELP_STRING([--enable-maintainer], [turn on maintainer mode, default=no])) +AC_ARG_ENABLE([sanitizer], AS_HELP_STRING([--enable-sanitizer], [build with AddressSanitizer, default=no])) + +AC_ARG_WITH([docdir], AS_HELP_STRING([--with-docdir], [set directory for documentation, default=${prefix}/share/doc/mxml]), [ + docdir="$withval" +], [ + docdir="NONE" +]) AC_SUBST(docdir) -AC_ARG_WITH(vsnprintf, [ --with-vsnprintf use vsnprintf emulation functions, default=auto], - use_vsnprintf="$withval", - use_vsnprintf="no") +AC_ARG_WITH([vsnprintf], AS_HELP_STRING([--with-vsnprintf], [use vsnprintf emulation functions, default=auto]), [ + use_vsnprintf="$withval" +], [ + use_vsnprintf="no" +]) + dnl Checks for programs... AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL -if test "$INSTALL" = "$ac_install_sh"; then - # Use full path to install-sh script... - INSTALL="`pwd`/install-sh -c" -fi +AS_IF([test "$INSTALL" = "$ac_install_sh"], [ + # Use full path to install-sh script... + INSTALL="`pwd`/install-sh -c" +]) AC_PROG_RANLIB AC_CHECK_TOOL(AR,ar) AC_PATH_PROG(CP,cp) @@ -84,264 +105,254 @@ AC_PATH_PROG(MKDIR,mkdir) AC_PATH_PROG(RM,rm) -dnl Flags for "ar" command... -case "$host_os_name" in - darwin* | *bsd) - ARFLAGS="-rcv" - ;; - *) - ARFLAGS="crvs" - ;; -esac +dnl Flags for "ar" command... +AS_CASE(["$host_os_name"], [darwin* | *bsd], [ + ARFLAGS="-rcv" +], [*], [ + ARFLAGS="crvs" +]) AC_SUBST(ARFLAGS) + dnl Inline functions... AC_C_INLINE + dnl Checks for string functions. -if test "x$use_ansi" != xyes; then - AC_CHECK_FUNCS(strdup strlcat strlcpy) -fi - -if test "x$use_vsnprintf" != xyes; then - AC_CHECK_FUNCS(snprintf vasprintf vsnprintf) -fi +AS_IF([test "x$use_ansi" != xyes], [ + AC_CHECK_FUNCS([strdup strlcat strlcpy]) +]) + +AS_IF([test "x$use_vsnprintf" != xyes], [ + AC_CHECK_FUNCS([snprintf vasprintf vsnprintf]) +]) + dnl Check for "long long" support... -AC_CACHE_CHECK(for long long int, ac_cv_c_long_long, - [if test "$GCC" = yes; then - ac_cv_c_long_long=yes - else - AC_TRY_COMPILE(,[long long int i;], - ac_cv_c_long_long=yes, - ac_cv_c_long_long=no) - fi]) - -if test $ac_cv_c_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG) -fi +AC_TYPE_LONG_LONG_INT + dnl Threading support -AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support]) +AC_ARG_ENABLE([threads], AS_HELP_STRING([--disable-threads], [disable multi-threading support, default=no])) have_pthread=no -PTHREAD_FLAGS="" -PTHREAD_LIBS="" - -if test "x$enable_threads" != xno; then - AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H)) +AS_IF([test "x$enable_threads" != xno], [ + AC_CHECK_HEADER([pthread.h], [ + AC_DEFINE([HAVE_PTHREAD_H], [Have ?]) + ]) + + AS_IF([test x$ac_cv_header_pthread_h = xyes], [ + dnl Check various threading options for the platforms we support + for flag in -lpthreads -lpthread -pthread; do + AC_MSG_CHECKING([for pthread_create using $flag]) + SAVELIBS="$LIBS" + LIBS="$flag $LIBS" + AC_LANG([C]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],[pthread_create(0, 0, 0, 0);])], [ + have_pthread=yes + ], [ + LIBS="$SAVELIBS" + ]) + + AS_IF([test x$have_pthread = xyes], [ + AC_MSG_RESULT([yes]) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -D_REENTRANT" + break + ], [ + AC_MSG_RESULT([no]) + ]) + done + ]) +]) - if test x$ac_cv_header_pthread_h = xyes; then - dnl Check various threading options for the platforms we support - for flag in -lpthreads -lpthread -pthread; do - AC_MSG_CHECKING([for pthread_create using $flag]) - SAVELIBS="$LIBS" - LIBS="$flag $LIBS" - AC_TRY_LINK([#include ], - [pthread_create(0, 0, 0, 0);], - have_pthread=yes) - AC_MSG_RESULT([$have_pthread]) - LIBS="$SAVELIBS" - - if test $have_pthread = yes; then - PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT" - PTHREAD_LIBS="$flag" - - # Solaris requires -D_POSIX_PTHREAD_SEMANTICS to - # be POSIX-compliant... :( - case "$host_os_name" in - sunos) - PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - break - fi - done - fi -fi - -AC_SUBST(PTHREAD_FLAGS) -AC_SUBST(PTHREAD_LIBS) dnl Shared library support... DSO="${DSO:=:}" DSOFLAGS="${DSOFLAGS:=}" -AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries, default=no]) +AC_ARG_ENABLE([shared], AS_HELP_STRING([--disable-shared], [turn off shared libraries, default=no])) -if test x$enable_shared != xno; then - AC_MSG_CHECKING(for shared library support) - PICFLAG=1 - - case "$host_os_name" in - sunos | unix_s) - AC_MSG_RESULT(yes) - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" - LDFLAGS="$LDFLAGS -R\$(libdir)" - ;; - - linux*) - AC_MSG_RESULT(yes) - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1 -shared \$(OPTIM)" - ;; - - osf | gnu) - AC_MSG_RESULT(yes) - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" - LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" - ;; - - *bsd | haiku*) - AC_MSG_RESULT(yes) - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" - LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" - ;; - - darwin) - AC_MSG_RESULT(yes) - LIBMXML="libmxml.1.dylib" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -lc" - ;; - - mingw) - AC_MSG_RESULT(yes) - LIBMXML="mxml1.dll" - DSO="\$(CC)" - DSOFLAGS="$DSOFLAGS -shared -Wl,--out-implib,libmxml1.a,--no-undefined,--enable-runtime-pseudo-reloc" - ;; - - *) - AC_MSG_RESULT(no) - AC_MSG_WARN(shared libraries not supported on this platform.) - PICFLAG=0 - LIBMXML="libmxml.a" - ;; - esac -else +AS_IF([test x$enable_shared != xno], [ + AC_MSG_CHECKING([for shared library support]) + PICFLAG=1 + + AS_CASE(["$host_os_name"], [sunos | unix_s], [ + AC_MSG_RESULT([yes]) + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" + LDFLAGS="$LDFLAGS -R\$(libdir)" + ], [linux*], [ + AC_MSG_RESULT([yes]) + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1 -shared \$(OPTIM)" + ], [osf | gnu], [ + AC_MSG_RESULT([yes]) + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" + LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" + ], [*bsd | haiku*], [ + AC_MSG_RESULT([yes]) + LIBMXML="libmxml.so.1.6" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" + LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" + ], [darwin], [ + AC_MSG_RESULT([yes]) + LIBMXML="libmxml.1.dylib" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS \$(RC_CFLAGS) -dynamiclib -lc" + ], [mingw], [ + AC_MSG_RESULT([yes]) + LIBMXML="mxml1.dll" + DSO="\$(CC)" + DSOFLAGS="$DSOFLAGS -shared -Wl,--out-implib,libmxml1.a,--no-undefined,--enable-runtime-pseudo-reloc" + ], [*], [ + AC_MSG_RESULT([no]) + AC_MSG_WARN([shared libraries not supported on this platform.]) PICFLAG=0 LIBMXML="libmxml.a" -fi + ]) +], [ + PICFLAG=0 + LIBMXML="libmxml.a" +]) + +AC_SUBST([DSO]) +AC_SUBST([DSOFLAGS]) +AC_SUBST([LIBMXML]) +AC_SUBST([PICFLAG]) + + +dnl Compiler options... +WARNINGS="" +AC_SUBST([WARNINGS]) + +AS_IF([test -n "$GCC"], [ + CFLAGS="-D_GNU_SOURCE $CFLAGS" + + AS_IF([test "x$OPTIM" = x], [ + AS_IF([test x$enable_debug = xyes], [ + OPTIM="-g" + ], [ + OPTIM="-g -Os" + ]) + ], [test x$enable_debug = xyes], [ + OPTIM="$OPTIM -g" + ]) + + AS_IF([test x$enable_sanitizer = xyes], [ + # Use -fsanitize=address with debugging... + OPTIM="$OPTIM -fsanitize=address" + ], [ + # Otherwise use the Fortify enhancements to catch any unbounded + # string operations... + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + ]) + + AS_IF([test "x$use_ansi" = xyes], [ + CFLAGS="-ansi -pedantic $CFLAGS" + ]) + + dnl Show all standard warnings + unused variables when compiling... + WARNINGS="-Wall -Wunused" + + dnl Drop some not-useful/unreliable warnings... + for warning in char-subscripts format-truncation format-y2k switch unused-result; do + AC_MSG_CHECKING([whether compiler supports -Wno-$warning]) + + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wno-$warning -Werror" + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ + AC_MSG_RESULT(yes) + WARNINGS="$WARNINGS -Wno-$warning" + ], [ + AC_MSG_RESULT(no) + ]) + + CFLAGS="$OLDCFLAGS" + done + + dnl Maintainer mode enables -Werror... + AS_IF([test x$enable_maintainer = xyes], [ + WARNINGS="$WARNINGS -Werror" + ]) + + AS_IF([test $PICFLAG = 1 -a "$host_os_name" != aix], [ + OPTIM="-fPIC $OPTIM" + ]) +], [ + AS_IF([test "x$OPTIM" = x], [ + AS_IF([test x$enable_debug = xyes], [ + OPTIM="-g" + ], [ + OPTIM="-O" + ]) + ]) + + AS_CASE(["$host_os_name"], [hp-ux], [ + CFLAGS="-Ae $CFLAGS" + + OPTIM="+DAportable $OPTIM" + + AS_IF([test $PICFLAG = 1], [ + OPTIM="+z $OPTIM" + ]) + ], [unix_svr | sunos], [ + AS_IF([test $PICFLAG = 1], [ + OPTIM="-KPIC $OPTIM" + ]) + ]) +]) -AC_SUBST(DSO) -AC_SUBST(DSOFLAGS) -AC_SUBST(LIBMXML) -AC_SUBST(PICFLAG) - -dnl Add -Wall for GCC... -if test -n "$GCC"; then - CFLAGS="-Wall -D_GNU_SOURCE $CFLAGS" - - if test "x$OPTIM" = x; then - OPTIM="-Os -g" - fi - - if test "x$use_ansi" = xyes; then - CFLAGS="-ansi -pedantic $CFLAGS" - fi - - if test $PICFLAG = 1 -a "$host_os_name" != aix; then - OPTIM="-fPIC $OPTIM" - fi -else - case "$host_os_name" in - hp-ux) - CFLAGS="-Ae $CFLAGS" - - if test "x$OPTIM" = x; then - OPTIM="-O" - fi - - OPTIM="+DAportable $OPTIM" - - if test $PICFLAG = 1; then - OPTIM="+z $OPTIM" - fi - ;; - - unix_svr | sunos) - if test "x$OPTIM" = x; then - OPTIM="-O" - fi - - if test $PICFLAG = 1; then - OPTIM="-KPIC $OPTIM" - fi - ;; - - *) - if test "x$OPTIM" = x; then - OPTIM="-O" - fi - ;; - esac -fi dnl Determine whether we are cross-compiling... -if test "$build" = "$host"; then - TARGETS="ALLTARGETS" -else - TARGETS="CROSSTARGETS" -fi -AC_SUBST(TARGETS) - -dnl Fix "prefix" variable if it hasn't been specified... -if test "$prefix" = "NONE"; then - prefix="/usr/local" -fi - -dnl Fix "exec_prefix" variable if it hasn't been specified... -if test "$exec_prefix" = "NONE"; then - exec_prefix="$prefix" -fi - -dnl Fix "docdir" variable if it hasn't been specified... -if test "$docdir" = "NONE"; then - docdir="$datadir/doc/mxml" -fi - -dnl Fix "mandir" variable if it hasn't been specified... -if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then - case "$host_os_name" in - *bsd | darwin | linux*) - # *BSD, Darwin (macOS), and Linux - mandir="/usr/share/man" - ;; - irix) - # SGI IRIX - mandir="/usr/share/catman/u_man" - ;; - *) - # All others - mandir="/usr/man" - ;; - esac -fi +AS_IF([test "$build" = "$host"], [ + TARGETS="ALLTARGETS" +], [ + TARGETS="CROSSTARGETS" +]) +AC_SUBST([TARGETS]) + + +dnl Fix installation directories... +AS_IF([test "$prefix" = "NONE"], [ + prefix="/usr/local" +]) + +AS_IF([test "$exec_prefix" = "NONE"], [ + exec_prefix="$prefix" +]) + +AS_IF([test "$docdir" = "NONE"], [ + docdir="$datadir/doc/mxml" +]) + +AS_IF([test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"], [ + mandir="/usr/share/man" +]) + dnl pkg-config stuff... -if test "$includedir" != /usr/include; then - PC_CFLAGS="-I$includedir" -else - PC_CFLAGS="" -fi - -if test "$libdir" != /usr/lib; then - PC_LIBS="-L$libdir -lmxml" -else - PC_LIBS="-lmxml" -fi +AS_IF([test "$includedir" != /usr/include], [ + PC_CFLAGS="-I$includedir" +], [ + PC_CFLAGS="" +]) +AC_SUBST([PC_CFLAGS]) + +AS_IF([test "$libdir" != /usr/lib], [ + PC_LIBS="-L$libdir -lmxml" +], [ + PC_LIBS="-lmxml" +]) +AC_SUBST([PC_LIBS]) -AC_SUBST(PC_CFLAGS) -AC_SUBST(PC_LIBS) dnl Output the makefile, etc... -AC_OUTPUT(Makefile mxml.pc) +AC_CONFIG_FILES([Makefile mxml.pc]) +AC_OUTPUT diff -Nru mxml-3.2/.cppcheck mxml-3.3/.cppcheck --- mxml-3.2/.cppcheck 1970-01-01 00:00:00.000000000 +0000 +++ mxml-3.3/.cppcheck 2021-11-09 13:48:36.000000000 +0000 @@ -0,0 +1,20 @@ +// Bad CERT recommendation: C memory layout not determined by variable locations +cert-API01-C + +// Cppcheck doesn't know enough about variables to know whether they are +// uninitialized... +uninitvar + +// Don't report non-const casts. Inline suppression comments are not working, +// otherwise we'd be more selective... +cert-EXP05-C + +// Not handling "(unsigned)~CONSTANT" properly... +cert-INT31-c + +// fopen_s is NOT supported on POSIX platforms and DOES NOT APPLY for reading +// of files! +cert-MSC24-C + +// Not sure why this is a thing... +preprocessorErrorDirective diff -Nru mxml-3.2/debian/changelog mxml-3.3/debian/changelog --- mxml-3.2/debian/changelog 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/changelog 2021-11-10 08:10:54.000000000 +0000 @@ -1,3 +1,10 @@ +mxml (3.3-1) unstable; urgency=medium + + * New upstream release + * Standards-Version: 4.6.0 + + -- Alastair McKinstry Wed, 10 Nov 2021 08:10:54 +0000 + mxml (3.2-1) unstable; urgency=medium * New upstream release diff -Nru mxml-3.2/debian/control mxml-3.3/debian/control --- mxml-3.2/debian/control 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/control 2021-11-10 08:10:54.000000000 +0000 @@ -2,7 +2,7 @@ Priority: optional Maintainer: Alastair McKinstry Build-Depends: debhelper-compat (= 13) -Standards-Version: 4.5.0 +Standards-Version: 4.6.0 Section: libs Vcs-Browser: https://salsa.debian.org:/mckinstry/mxml.git Vcs-Git: https://salsa.debian.org:/mckinstry/mxml.git -b debian/latest diff -Nru mxml-3.2/debian/patches/01_remove_rpath.diff mxml-3.3/debian/patches/01_remove_rpath.diff --- mxml-3.2/debian/patches/01_remove_rpath.diff 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/01_remove_rpath.diff 2021-11-10 08:10:54.000000000 +0000 @@ -1,26 +1,3 @@ Patch to remove rpath from configure.in and configure. Added by Fathi Boudra Sun, 19 Aug 2007 14:52:14 +0200 Debian Version: 2.3-1 -Index: mxml-3.2/configure.ac -=================================================================== ---- mxml-3.2.orig/configure.ac -+++ mxml-3.2/configure.ac -@@ -179,8 +179,7 @@ if test x$enable_shared != xno; then - AC_MSG_RESULT(yes) - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" -- DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" -- LDFLAGS="$LDFLAGS -R\$(libdir)" -+ DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G \$(OPTIM)" - ;; - - linux*) -@@ -202,7 +201,7 @@ if test x$enable_shared != xno; then - AC_MSG_RESULT(yes) - LIBMXML="libmxml.so.1.6" - DSO="\$(CC)" -- DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" -+ DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1 -shared \$(OPTIM)" - LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" - ;; - diff -Nru mxml-3.2/debian/patches/03_link_ldflags.diff mxml-3.3/debian/patches/03_link_ldflags.diff --- mxml-3.2/debian/patches/03_link_ldflags.diff 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/03_link_ldflags.diff 2021-11-10 08:10:54.000000000 +0000 @@ -1,10 +1,8 @@ Patch to add missing $(LDFLAGS) to Makefile Added by Luis Uribe Thu, 16 Aug 2012 21:12:59 -0500 -Index: mxml-3.2/Makefile.in -=================================================================== ---- mxml-3.2.orig/Makefile.in -+++ mxml-3.2/Makefile.in -@@ -242,7 +242,7 @@ mxml1.dll: $(LIBOBJS) +--- a/Makefile.in ++++ b/Makefile.in +@@ -272,7 +272,7 @@ libmxml.so.1.6: $(LIBOBJS) echo Creating $@... diff -Nru mxml-3.2/debian/patches/04_compile_headers.diff mxml-3.3/debian/patches/04_compile_headers.diff --- mxml-3.2/debian/patches/04_compile_headers.diff 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/04_compile_headers.diff 2021-11-10 08:10:54.000000000 +0000 @@ -1,7 +1,5 @@ -Index: mxml-3.2/mxml-string.c -=================================================================== ---- mxml-3.2.orig/mxml-string.c -+++ mxml-3.2/mxml-string.c +--- a/mxml-string.c ++++ b/mxml-string.c @@ -14,7 +14,8 @@ */ diff -Nru mxml-3.2/debian/patches/06_autoheader-fixes.patch mxml-3.3/debian/patches/06_autoheader-fixes.patch --- mxml-3.2/debian/patches/06_autoheader-fixes.patch 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/06_autoheader-fixes.patch 2021-11-10 08:10:54.000000000 +0000 @@ -1,40 +1,33 @@ -Index: mxml-3.2/configure.ac -=================================================================== ---- mxml-3.2.orig/configure.ac -+++ mxml-3.2/configure.ac -@@ -15,7 +15,7 @@ AC_INIT([Mini-XML], [3.2], [https://gith +--- a/configure.ac ++++ b/configure.ac +@@ -20,7 +20,7 @@ dnl This line is provided to ensure that you don't run the autoheader program dnl against this project. Doing so is completely unsupported and WILL cause dnl problems! -AH_TOP([#error "Somebody ran autoheader on this project which is unsupported and WILL cause problems."]) +dnl AH_TOP([#error "Somebody ran autoheader on this project which is unsupported and WILL cause problems."]) + dnl Get the build and host platforms and split the host_os value - AC_CANONICAL_BUILD -@@ -30,7 +30,7 @@ AC_CONFIG_HEADER(config.h) +@@ -38,7 +38,7 @@ dnl Version number... VERSION="AC_PACKAGE_VERSION" AC_SUBST(VERSION) -AC_DEFINE_UNQUOTED(MXML_VERSION, "Mini-XML v$VERSION") +AC_DEFINE_UNQUOTED(MXML_VERSION, "Mini-XML v$VERSION", "MXML VERSION") - dnl Clear default debugging options and set normal optimization by - dnl default unless the user asks for debugging specifically. -@@ -119,7 +119,7 @@ AC_CACHE_CHECK(for long long int, ac_cv_ - fi]) - - if test $ac_cv_c_long_long = yes; then -- AC_DEFINE(HAVE_LONG_LONG) -+ AC_DEFINE(HAVE_LONG_LONG, 1, "long long int support") - fi + dnl Clear default debugging options and set normal optimization by +@@ -136,10 +136,11 @@ dnl Threading support -@@ -130,7 +130,7 @@ PTHREAD_FLAGS="" - PTHREAD_LIBS="" + AC_ARG_ENABLE([threads], AS_HELP_STRING([--disable-threads], [disable multi-threading support, default=no])) - if test "x$enable_threads" != xno; then -- AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H)) -+ AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H, 1, "pthreads headers available")) ++ + have_pthread=no + AS_IF([test "x$enable_threads" != xno], [ + AC_CHECK_HEADER([pthread.h], [ +- AC_DEFINE([HAVE_PTHREAD_H], [Have ?]) ++ AC_DEFINE([HAVE_PTHREAD_H], 1, [Have ?]) + ]) - if test x$ac_cv_header_pthread_h = xyes; then - dnl Check various threading options for the platforms we support + AS_IF([test x$ac_cv_header_pthread_h = xyes], [ diff -Nru mxml-3.2/debian/patches/07_compile_fixes.patch mxml-3.3/debian/patches/07_compile_fixes.patch --- mxml-3.2/debian/patches/07_compile_fixes.patch 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/07_compile_fixes.patch 2021-11-10 08:10:54.000000000 +0000 @@ -3,10 +3,8 @@ Last-Updated: 2019-08-22 Forwarded: no -Index: mxml-3.2/mxml.h -=================================================================== ---- mxml-3.2.orig/mxml.h -+++ mxml-3.2/mxml.h +--- a/mxml.h ++++ b/mxml.h @@ -25,7 +25,7 @@ # include # include @@ -16,10 +14,8 @@ /* * Constants... -Index: mxml-3.2/mxml-string.c -=================================================================== ---- mxml-3.2.orig/mxml-string.c -+++ mxml-3.2/mxml-string.c +--- a/mxml-string.c ++++ b/mxml-string.c @@ -14,6 +14,8 @@ */ @@ -29,11 +25,9 @@ #include #include -Index: mxml-3.2/mxml-private.h -=================================================================== ---- mxml-3.2.orig/mxml-private.h -+++ mxml-3.2/mxml-private.h -@@ -100,4 +100,8 @@ typedef struct _mxml_global_s /**** Glo +--- a/mxml-private.h ++++ b/mxml-private.h +@@ -100,4 +100,8 @@ extern _mxml_global_t *_mxml_global(void); extern int _mxml_entity_cb(const char *name); diff -Nru mxml-3.2/debian/patches/08_cross.patch mxml-3.3/debian/patches/08_cross.patch --- mxml-3.2/debian/patches/08_cross.patch 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/08_cross.patch 2021-11-10 08:10:54.000000000 +0000 @@ -4,11 +4,9 @@ Last-Updated: 2018-09-23 Forwarded: not-needed -Index: mxml-3.2/Makefile.in -=================================================================== ---- mxml-3.2.orig/Makefile.in -+++ mxml-3.2/Makefile.in -@@ -82,7 +82,7 @@ PUBLIBOBJS = mxml-attr.o mxml-entity.o m +--- a/Makefile.in ++++ b/Makefile.in +@@ -84,7 +84,7 @@ LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o OBJS = testmxml.o $(LIBOBJS) ALLTARGETS = $(LIBMXML) testmxml diff -Nru mxml-3.2/debian/patches/series mxml-3.3/debian/patches/series --- mxml-3.2/debian/patches/series 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/series 2021-11-10 08:10:54.000000000 +0000 @@ -1,4 +1,4 @@ -01_remove_rpath.diff +# 01_remove_rpath.diff 03_link_ldflags.diff 04_compile_headers.diff tests-fail-on-error.diff diff -Nru mxml-3.2/debian/patches/tests-fail-on-error.diff mxml-3.3/debian/patches/tests-fail-on-error.diff --- mxml-3.2/debian/patches/tests-fail-on-error.diff 2020-10-13 13:21:09.000000000 +0000 +++ mxml-3.3/debian/patches/tests-fail-on-error.diff 2021-11-10 08:10:54.000000000 +0000 @@ -3,11 +3,9 @@ Forwarded: not-needed Last-Updated: 2016-08-29 -Index: mxml-3.2/Makefile.in -=================================================================== ---- mxml-3.2.orig/Makefile.in -+++ mxml-3.2/Makefile.in -@@ -278,18 +278,21 @@ testmxml: libmxml.a testmxml.o +--- a/Makefile.in ++++ b/Makefile.in +@@ -216,18 +216,21 @@ $(RM) temp2.xml temp2s.xml; \ else \ echo Stdio file test failed!; \ @@ -28,4 +26,4 @@ + false ; \ fi - testmxml-vg: $(LIBOBJS) testmxml.o + diff -Nru mxml-3.2/doc/body.md mxml-3.3/doc/body.md --- mxml-3.2/doc/body.md 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/doc/body.md 2021-11-09 13:48:36.000000000 +0000 @@ -1,8 +1,8 @@ --- -title: Mini-XML 3.2 API Reference +title: Mini-XML 3.3 Programming Manual author: Michael R Sweet -copyright: Copyright © 2003-2020, All Rights Reserved. -version: 3.2 +copyright: Copyright © 2003-2021, All Rights Reserved. +version: 3.3 ... # Introduction @@ -49,7 +49,7 @@ Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML implementation and now stands -at a whopping 4,186 lines of code, compared to 196,141 lines of code for libxml2 +at a whopping 4,300 lines of code, compared to 196,141 lines of code for libxml2 version 2.9.9. @@ -62,7 +62,7 @@ ## Legal Stuff -The Mini-XML library is copyright © 2003-2019 by Michael R Sweet and is provided +The Mini-XML library is copyright © 2003-2021 by Michael R Sweet and is provided under the Apache License Version 2.0 with an exception to allow linking against GPL2/LGPL2-only software. See the files "LICENSE" and "NOTICE" for more information. diff -Nru mxml-3.2/doc/footer.man mxml-3.3/doc/footer.man --- mxml-3.2/doc/footer.man 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/doc/footer.man 2021-11-09 13:48:36.000000000 +0000 @@ -1,4 +1,4 @@ .SH SEE ALSO Mini-XML Programmers Manual, https://www.msweet.org/mxml .SH COPYRIGHT -Copyright \[co] 2003-2019 by Michael R Sweet. +Copyright \[co] 2003-2021 by Michael R Sweet. Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml-128.png and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml-128.png differ diff -Nru mxml-3.2/doc/mxml.3 mxml-3.3/doc/mxml.3 --- mxml-3.2/doc/mxml.3 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/doc/mxml.3 2021-11-09 13:48:36.000000000 +0000 @@ -1,4 +1,4 @@ -.TH mxml 3 "Mini-XML API" "2020-10-09" "Mini-XML API" +.TH mxml 3 "Mini-XML API" "2021-10-26" "Mini-XML API" .SH NAME mxml \- Mini-XML API .SH INCLUDE FILE @@ -1040,12 +1040,11 @@ .PP This function returns a pointer to a string containing the textual representation of the XML node tree. The string should be freed -using the free() function when you are done with it. \fBNULL\fR is returned -if the node would produce an empty string or if the string cannot be -allocated. +using \fBfree()\fR when you are done with it. \fBNULL\fR is returned if the node +would produce an empty string or if the string cannot be allocated. .PP The callback argument specifies a function that returns a whitespace -string or NULL before and after each element. If \fBMXML_NO_CALLBACK\fR +string or \fBNULL\fR before and after each element. If \fBMXML_NO_CALLBACK\fR is specified, whitespace will only be added before \fBMXML_TEXT\fR nodes with leading whitespace and before attribute names inside opening element tags. @@ -1362,4 +1361,4 @@ .SH SEE ALSO Mini-XML Programmers Manual, https://www.msweet.org/mxml .SH COPYRIGHT -Copyright \[co] 2003-2019 by Michael R Sweet. +Copyright \[co] 2003-2021 by Michael R Sweet. Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml-cover.jpg and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml-cover.jpg differ Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml-cover.opacity and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml-cover.opacity differ Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml-cover.png and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml-cover.png differ Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml.epub and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml.epub differ diff -Nru mxml-3.2/doc/mxml.html mxml-3.3/doc/mxml.html --- mxml-3.2/doc/mxml.html 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/doc/mxml.html 2021-11-09 13:48:36.000000000 +0000 @@ -1,14 +1,14 @@ - - Mini-XML 3.2 API Reference - - - - - - - - - -
-

-

Mini-XML 3.2 API Reference

-

Michael R Sweet

-

Copyright © 2003-2020, All Rights Reserved.

-
-
-

Contents

- -
-
-

Introduction

-

Mini-XML is a small XML parsing library that you can use to read XML data files or strings in your application without requiring large non-standard libraries. Mini-XML provides the following functionality:

-
    -
  • Reading of UTF-8 and UTF-16 and writing of UTF-8 encoded XML files and strings.

    -
  • -
  • Data is stored in a linked-list tree structure, preserving the XML data hierarchy.

    -
  • -
  • SAX (streamed) reading of XML files and strings to minimize memory usage.

    + + +
    +

    +

    Mini-XML 3.3 Programming Manual

    +

    Michael R Sweet

    +

    Copyright © 2003-2021, All Rights Reserved.

    +
    +
    +

    Contents

    + +
    +
    +

    Introduction

    +

    Mini-XML is a small XML parsing library that you can use to read XML data files or strings in your application without requiring large non-standard libraries. Mini-XML provides the following functionality:

    +
      +
    • Reading of UTF-8 and UTF-16 and writing of UTF-8 encoded XML files and strings.

      +
    • +
    • Data is stored in a linked-list tree structure, preserving the XML data hierarchy.

    • -
    • Supports arbitrary element names, attributes, and attribute values with no preset limits, just available memory.

      +
    • SAX (streamed) reading of XML files and strings to minimize memory usage.

    • -
    • Supports integer, real, opaque ("cdata"), and text data types in "leaf" nodes.

      +
    • Supports arbitrary element names, attributes, and attribute values with no preset limits, just available memory.

    • -
    • Functions for creating and managing trees of data.

      +
    • Supports integer, real, opaque ("cdata"), and text data types in "leaf" nodes.

    • -
    • "Find" and "walk" functions for easily locating and navigating trees of data.

      +
    • Functions for creating and managing trees of data.

      +
    • +
    • "Find" and "walk" functions for easily locating and navigating trees of data.

    -

    Mini-XML doesn't do validation or other types of processing on the data based upon schema files or other sources of definition information.

    -

    History

    -

    Mini-XML was initially developed for the Gutenprint project to replace the rather large and unwieldy libxml2 library with something substantially smaller and easier-to-use. It all began one morning in June of 2003 when Robert posted the following sentence to the developer's list:

    -
    -

    It's bad enough that we require libxml2, but rolling our own XML parser is a bit more than we can handle.

    +

    Mini-XML doesn't do validation or other types of processing on the data based upon schema files or other sources of definition information.

    +

    History

    +

    Mini-XML was initially developed for the Gutenprint project to replace the rather large and unwieldy libxml2 library with something substantially smaller and easier-to-use. It all began one morning in June of 2003 when Robert posted the following sentence to the developer's list:

    +
    +

    It's bad enough that we require libxml2, but rolling our own XML parser is a bit more than we can handle.

    -

    I then replied with:

    -
    -

    Given the limited scope of what you use in XML, it should be trivial to code a mini-XML API in a few hundred lines of code.

    +

    I then replied with:

    +
    +

    Given the limited scope of what you use in XML, it should be trivial to code a mini-XML API in a few hundred lines of code.

    -

    I took my own challenge and coded furiously for two days to produced the initial public release of Mini-XML, total lines of code: 696. Robert promptly integrated Mini-XML into Gutenprint and removed libxml2.

    -

    Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML implementation and now stands at a whopping 4,186 lines of code, compared to 196,141 lines of code for libxml2 version 2.9.9.

    -

    Resources

    -

    The Mini-XML home page can be found at https://www.msweet.org/mxml. From there you can download the current version of Mini-XML, access the issue tracker, and find other resources.

    - -

    The Mini-XML library is copyright © 2003-2019 by Michael R Sweet and is provided under the Apache License Version 2.0 with an exception to allow linking against GPL2/LGPL2-only software. See the files "LICENSE" and "NOTICE" for more information.

    -

    Using Mini-XML

    -

    Mini-XML provides a single header file which you include:

    -
    #include <mxml.h>
    -
    -

    The Mini-XML library is included with your program using the -lmxml option:

    -
    gcc -o myprogram myprogram.c -lmxml
    -
    -

    If you have the pkg-config software installed, you can use it to determine the proper compiler and linker options for your installation:

    -
    gcc `pkg-config --cflags mxml` -o myprogram myprogram.c `pkg-config --libs mxml`
    -
    -

    Loading an XML File

    -

    You load an XML file using the mxmlLoadFile function:

    -
    mxml_node_t *
    +

    I took my own challenge and coded furiously for two days to produced the initial public release of Mini-XML, total lines of code: 696. Robert promptly integrated Mini-XML into Gutenprint and removed libxml2.

    +

    Thanks to lots of feedback and support from various developers, Mini-XML has evolved since then to provide a more complete XML implementation and now stands at a whopping 4,300 lines of code, compared to 196,141 lines of code for libxml2 version 2.9.9.

    +

    Resources

    +

    The Mini-XML home page can be found at https://www.msweet.org/mxml. From there you can download the current version of Mini-XML, access the issue tracker, and find other resources.

    + +

    The Mini-XML library is copyright © 2003-2021 by Michael R Sweet and is provided under the Apache License Version 2.0 with an exception to allow linking against GPL2/LGPL2-only software. See the files "LICENSE" and "NOTICE" for more information.

    +

    Using Mini-XML

    +

    Mini-XML provides a single header file which you include:

    +
    #include <mxml.h>
    +
    +

    The Mini-XML library is included with your program using the -lmxml option:

    +
    gcc -o myprogram myprogram.c -lmxml
    +
    +

    If you have the pkg-config software installed, you can use it to determine the proper compiler and linker options for your installation:

    +
    gcc `pkg-config --cflags mxml` -o myprogram myprogram.c `pkg-config --libs mxml`
    +
    +

    Loading an XML File

    +

    You load an XML file using the mxmlLoadFile function:

    +
    mxml_node_t *
     mxmlLoadFile(mxml_node_t *top, FILE *fp,
                  mxml_type_t (*cb)(mxml_node_t *));
     
    -

    The cb argument specifies a function that assigns child (value) node types for each element in the document. The callback can be a function you provide or one of the standard functions provided with Mini-XML. For example, to load the XML file "filename.xml" containing text strings you can use the MXML_OPAQUE_CALLBACK function:

    -
    FILE *fp;
    +

    The cb argument specifies a function that assigns child (value) node types for each element in the document. The callback can be a function you provide or one of the standard functions provided with Mini-XML. For example, to load the XML file "filename.xml" containing text strings you can use the MXML_OPAQUE_CALLBACK function:

    +
    FILE *fp;
     mxml_node_t *tree;
     
     fp = fopen("filename.xml", "r");
     tree = mxmlLoadFile(NULL, fp, MXML_OPAQUE_CALLBACK);
     fclose(fp);
     
    -

    Mini-XML also provides functions to load from a file descriptor or string:

    -
    mxml_node_t *
    +

    Mini-XML also provides functions to load from a file descriptor or string:

    +
    mxml_node_t *
     mxmlLoadFd(mxml_node_t *top, int fd,
                mxml_type_t (*cb)(mxml_node_t *));
     
    @@ -424,21 +444,21 @@
     mxmlLoadString(mxml_node_t *top, const char *s,
                    mxml_type_t (*cb)(mxml_node_t *));
     
    -

    Load Callbacks

    -

    The last argument to the mxmlLoad functions is a callback function which is used to determine the value type of each data node in an XML document. Mini-XML defines several standard callbacks for simple XML data files:

    -
      -
    • MXML_INTEGER_CALLBACK: All data nodes contain whitespace-separated integers.

      +

      Load Callbacks

      +

      The last argument to the mxmlLoad functions is a callback function which is used to determine the value type of each data node in an XML document. Mini-XML defines several standard callbacks for simple XML data files:

      +
        +
      • MXML_INTEGER_CALLBACK: All data nodes contain whitespace-separated integers.

      • -
      • MXML_OPAQUE_CALLBACK: All data nodes contain opaque strings with whitespace preserved.

        +
      • MXML_OPAQUE_CALLBACK: All data nodes contain opaque strings with whitespace preserved.

      • -
      • MXML_REAL_CALLBACK - All data nodes contain whitespace-separated floating-point numbers.

        +
      • MXML_REAL_CALLBACK - All data nodes contain whitespace-separated floating-point numbers.

      • -
      • MXML_TEXT_CALLBACK - All data nodes contain whitespace-separated strings.

        +
      • MXML_TEXT_CALLBACK - All data nodes contain whitespace-separated strings.

      -

      You can provide your own callback functions for more complex XML documents. Your callback function will receive a pointer to the current element node and must return the value type of the immediate children for that element node: MXML_CUSTOM, MXML_INTEGER, MXML_OPAQUE, MXML_REAL, or MXML_TEXT. The function is called after the element and its attributes have been read, so you can look at the element name, attributes, and attribute values to determine the proper value type to return.

      -

      The following callback function looks for an attribute named "type" or the element name to determine the value type for its child nodes:

      -
      mxml_type_t
      +

      You can provide your own callback functions for more complex XML documents. Your callback function will receive a pointer to the current element node and must return the value type of the immediate children for that element node: MXML_CUSTOM, MXML_INTEGER, MXML_OPAQUE, MXML_REAL, or MXML_TEXT. The function is called after the element and its attributes have been read, so you can look at the element name, attributes, and attribute values to determine the proper value type to return.

      +

      The following callback function looks for an attribute named "type" or the element name to determine the value type for its child nodes:

      +
      mxml_type_t
       type_cb(mxml_node_t *node)
       {
         const char *type;
      @@ -462,18 +482,18 @@
           return (MXML_TEXT);
       }
       
      -

      To use this callback function, simply use the name when you call any of the load functions:

      -
      FILE *fp;
      +

      To use this callback function, simply use the name when you call any of the load functions:

      +
      FILE *fp;
       mxml_node_t *tree;
       
       fp = fopen("filename.xml", "r");
       tree = mxmlLoadFile(NULL, fp, type_cb);
       fclose(fp);
       
      -

      Nodes

      -

      Every piece of information in an XML file is stored in memory in "nodes". Nodes are defined by the mxml_node_t structure. Each node has a typed value, optional user data, a parent node, sibling nodes (previous and next), and potentially child nodes.

      -

      For example, if you have an XML file like the following:

      -
      <?xml version="1.0" encoding="utf-8"?>
      +

      Nodes

      +

      Every piece of information in an XML file is stored in memory in "nodes". Nodes are defined by the mxml_node_t structure. Each node has a typed value, optional user data, a parent node, sibling nodes (previous and next), and potentially child nodes.

      +

      For example, if you have an XML file like the following:

      +
      <?xml version="1.0" encoding="utf-8"?>
       <data>
           <node>val1</node>
           <node>val2</node>
      @@ -487,8 +507,8 @@
           <node>val8</node>
       </data>
       
      -

      the node tree for the file would look like the following in memory:

      -
      ?xml version="1.0" encoding="utf-8"?
      +

      the node tree for the file would look like the following in memory:

      +
      ?xml version="1.0" encoding="utf-8"?
         |
       data
         |
      @@ -500,30 +520,30 @@
                              |      |      |
                            val4   val5   val6
       
      -

      where "-" is a pointer to the sibling node and "|" is a pointer to the first child or parent node.

      -

      The mxmlGetType function gets the type of a node:

      -
      mxml_type_t
      +

      where "-" is a pointer to the sibling node and "|" is a pointer to the first child or parent node.

      +

      The mxmlGetType function gets the type of a node:

      +
      mxml_type_t
       mxmlGetType(mxml_node_t *node);
       
      -
        -
      • MXML_CUSTOM : A custom value defined by your application,

        +
          +
        • MXML_CUSTOM : A custom value defined by your application,

        • -
        • MXML_ELEMENT : An XML element, CDATA, comment, or processing instruction,

          +
        • MXML_ELEMENT : An XML element, CDATA, comment, or processing instruction,

        • -
        • MXML_INTEGER : A whitespace-delimited integer value,

          +
        • MXML_INTEGER : A whitespace-delimited integer value,

        • -
        • MXML_OPAQUE : An opaque string value that preserves all whitespace,

          +
        • MXML_OPAQUE : An opaque string value that preserves all whitespace,

        • -
        • MXML_REAL : A whitespace-delimited floating point value, or

          +
        • MXML_REAL : A whitespace-delimited floating point value, or

        • -
        • MXML_TEXT : A whitespace-delimited text (fragment) value.

          +
        • MXML_TEXT : A whitespace-delimited text (fragment) value.

        -
        -

        Note: CDATA, comment, and processing directive nodes are currently stored in memory as special elements. This will be changed in a future major release of Mini-XML.

        +
        +

        Note: CDATA, comment, and processing directive nodes are currently stored in memory as special elements. This will be changed in a future major release of Mini-XML.

        -

        The parent and sibling nodes are accessed using the mxmlGetParent, mxmlGetNextSibling, and mxmlGetPreviousSibling functions, while the children of an element node are accessed using the mxmlGetFirstChild or mxmlGetLastChild functions:

        -
        mxml_node_t *
        +

        The parent and sibling nodes are accessed using the mxmlGetParent, mxmlGetNextSibling, and mxmlGetPreviousSibling functions, while the children of an element node are accessed using the mxmlGetFirstChild or mxmlGetLastChild functions:

        +
        mxml_node_t *
         mxmlGetFirstChild(mxml_node_t *node);
         
         mxml_node_t *
        @@ -538,13 +558,13 @@
         mxml_node_t *
         mxmlGetPrevSibling(mxml_node_t *node);
         
        -

        The mxmlGetUserData function gets any user (application) data associated with the node:

        -
        void *
        +

        The mxmlGetUserData function gets any user (application) data associated with the node:

        +
        void *
         mxmlGetUserData(mxml_node_t *node);
         
        -

        Creating XML Documents

        -

        You can create and update XML documents in memory using the various mxmlNew functions. The following code will create the XML document described in the previous section:

        -
        mxml_node_t *xml;    /* <?xml ... ?> */
        +

        Creating XML Documents

        +

        You can create and update XML documents in memory using the various mxmlNew functions. The following code will create the XML document described in the previous section:

        +
        mxml_node_t *xml;    /* <?xml ... ?> */
         mxml_node_t *data;   /* <data> */
         mxml_node_t *node;   /* <node> */
         mxml_node_t *group;  /* <group> */
        @@ -574,32 +594,32 @@
             node = mxmlNewElement(data, "node");
             mxmlNewText(node, 0, "val8");
         
        -

        We start by creating the declaration node common to all XML files using the mxmlNewXML function:

        -
        xml = mxmlNewXML("1.0");
        +

        We start by creating the declaration node common to all XML files using the mxmlNewXML function:

        +
        xml = mxmlNewXML("1.0");
         
        -

        We then create the <data> node used for this document using the mxmlNewElement function. The first argument specifies the parent node (xml) while the second specifies the element name (data):

        -
        data = mxmlNewElement(xml, "data");
        +

        We then create the <data> node used for this document using the mxmlNewElement function. The first argument specifies the parent node (xml) while the second specifies the element name (data):

        +
        data = mxmlNewElement(xml, "data");
         
        -

        Each <node>...</node> in the file is created using the mxmlNewElement and mxmlNewText functions. The first argument of mxmlNewText specifies the parent node (node). The second argument specifies whether whitespace appears before the text - 0 or false in this case. The last argument specifies the actual text to add:

        -
        node = mxmlNewElement(data, "node");
        +

        Each <node>...</node> in the file is created using the mxmlNewElement and mxmlNewText functions. The first argument of mxmlNewText specifies the parent node (node). The second argument specifies whether whitespace appears before the text - 0 or false in this case. The last argument specifies the actual text to add:

        +
        node = mxmlNewElement(data, "node");
         mxmlNewText(node, 0, "val1");
         
        -

        The resulting in-memory XML document can then be saved or processed just like one loaded from disk or a string.

        -

        Saving an XML File

        -

        You save an XML file using the mxmlSaveFile function:

        -
        int
        +

        The resulting in-memory XML document can then be saved or processed just like one loaded from disk or a string.

        +

        Saving an XML File

        +

        You save an XML file using the mxmlSaveFile function:

        +
        int
         mxmlSaveFile(mxml_node_t *node, FILE *fp,
                      mxml_save_cb_t cb);
         
        -

        The cb argument specifies a function that returns the whitespace (if any) that is inserted before and after each element node. The MXML_NO_CALLBACK constant tells Mini-XML to not include any extra whitespace. For example, so save an XML file to the file "filename.xml" with no extra whitespace:

        -
        FILE *fp;
        +

        The cb argument specifies a function that returns the whitespace (if any) that is inserted before and after each element node. The MXML_NO_CALLBACK constant tells Mini-XML to not include any extra whitespace. For example, so save an XML file to the file "filename.xml" with no extra whitespace:

        +
        FILE *fp;
         
         fp = fopen("filename.xml", "w");
         mxmlSaveFile(xml, fp, MXML_NO_CALLBACK);
         fclose(fp);
         
        -

        Mini-XML also provides functions to save to a file descriptor or strings:

        -
        char *
        +

        Mini-XML also provides functions to save to a file descriptor or strings:

        +
        char *
         mxmlSaveAllocString(mxml_node_t *node, mxml_save_cb_t cb);
         
         int
        @@ -609,20 +629,20 @@
         mxmlSaveString(mxml_node_t *node, char *buffer, int bufsize,
                        mxml_save_cb_t cb);
         
        -

        Controlling Line Wrapping

        -

        When saving XML documents, Mini-XML normally wraps output lines at column 75 so that the text is readable in terminal windows. The mxmlSetWrapMargin function overrides the default wrap margin for the current thread:

        -
        void mxmlSetWrapMargin(int column);
        -
        -

        For example, the following code sets the margin to 132 columns:

        -
        mxmlSetWrapMargin(132);
        -
        -

        while the following code disables wrapping by setting the margin to 0:

        -
        mxmlSetWrapMargin(0);
        -
        -

        Save Callbacks

        -

        The last argument to the mxmlSave functions is a callback function which is used to automatically insert whitespace in an XML document. Your callback function will be called up to four times for each element node with a pointer to the node and a "where" value of MXML_WS_BEFORE_OPEN, MXML_WS_AFTER_OPEN, MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback function should return NULL if no whitespace should be added or the string to insert (spaces, tabs, carriage returns, and newlines) otherwise.

        -

        The following whitespace callback can be used to add whitespace to XHTML output to make it more readable in a standard text editor:

        -
        const char *
        +

        Controlling Line Wrapping

        +

        When saving XML documents, Mini-XML normally wraps output lines at column 75 so that the text is readable in terminal windows. The mxmlSetWrapMargin function overrides the default wrap margin for the current thread:

        +
        void mxmlSetWrapMargin(int column);
        +
        +

        For example, the following code sets the margin to 132 columns:

        +
        mxmlSetWrapMargin(132);
        +
        +

        while the following code disables wrapping by setting the margin to 0:

        +
        mxmlSetWrapMargin(0);
        +
        +

        Save Callbacks

        +

        The last argument to the mxmlSave functions is a callback function which is used to automatically insert whitespace in an XML document. Your callback function will be called up to four times for each element node with a pointer to the node and a "where" value of MXML_WS_BEFORE_OPEN, MXML_WS_AFTER_OPEN, MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback function should return NULL if no whitespace should be added or the string to insert (spaces, tabs, carriage returns, and newlines) otherwise.

        +

        The following whitespace callback can be used to add whitespace to XHTML output to make it more readable in a standard text editor:

        +
        const char *
         whitespace_cb(mxml_node_t *node, int where)
         {
           const char *element;
        @@ -686,24 +706,24 @@
           return (NULL);
         }
         
        -

        To use this callback function, simply use the name when you call any of the save functions:

        -
        FILE *fp;
        +

        To use this callback function, simply use the name when you call any of the save functions:

        +
        FILE *fp;
         mxml_node_t *tree;
         
         fp = fopen("filename.xml", "w");
         mxmlSaveFile(tree, fp, whitespace_cb);
         fclose(fp);
         
        -

        Memory Management

        -

        Once you are done with the XML data, use the mxmlDelete function to recursively free the memory that is used for a particular node or the entire tree:

        -
        void
        +

        Memory Management

        +

        Once you are done with the XML data, use the mxmlDelete function to recursively free the memory that is used for a particular node or the entire tree:

        +
        void
         mxmlDelete(mxml_node_t *tree);
         
        -

        You can also use reference counting to manage memory usage. The mxmlRetain and mxmlRelease functions increment and decrement a node's use count, respectively. When the use count goes to zero, mxmlRelease automatically calls mxmlDelete to actually free the memory used by the node tree. New nodes start with a use count of 1.

        -

        More About Nodes

        -

        Element Nodes

        -

        Element (MXML_ELEMENT) nodes are created using the mxmlNewElement function. Element attributes are set using the mxmlElementSetAttr and mxmlElementSetAttrf functions and cleared using the mxmlElementDeleteAttr function:

        -
        mxml_node_t *
        +

        You can also use reference counting to manage memory usage. The mxmlRetain and mxmlRelease functions increment and decrement a node's use count, respectively. When the use count goes to zero, mxmlRelease automatically calls mxmlDelete to actually free the memory used by the node tree. New nodes start with a use count of 1.

        +

        More About Nodes

        +

        Element Nodes

        +

        Element (MXML_ELEMENT) nodes are created using the mxmlNewElement function. Element attributes are set using the mxmlElementSetAttr and mxmlElementSetAttrf functions and cleared using the mxmlElementDeleteAttr function:

        +
        mxml_node_t *
         mxmlNewElement(mxml_node_t *parent, const char *name);
         
         void
        @@ -717,12 +737,12 @@
         mxmlElementSetAttrf(mxml_node_t *node, const char *name,
                             const char *format, ...);
         
        -

        Child nodes are added using the various mxmlNew functions. The top (root) node must be an element, usually created by the mxmlNewXML function:

        -
        mxml_node_t *
        +

        Child nodes are added using the various mxmlNew functions. The top (root) node must be an element, usually created by the mxmlNewXML function:

        +
        mxml_node_t *
         mxmlNewXML(const char *version);
         
        -

        The mxmlGetElement function retrieves the element name, the mxmlElementGetAttr function retrieves the value string for a named attribute associated with the element. The mxmlElementGetAttrByIndex and mxmlElementGetAttrCount functions retrieve attributes by index:

        -
        const char *
        +

        The mxmlGetElement function retrieves the element name, the mxmlElementGetAttr function retrieves the value string for a named attribute associated with the element. The mxmlElementGetAttrByIndex and mxmlElementGetAttrCount functions retrieve attributes by index:

        +
        const char *
         mxmlGetElement(mxml_node_t *node);
         
         const char *
        @@ -735,50 +755,50 @@
         int
         mxmlElementGetAttrCount(mxml_node_t *node);
         
        -

        CDATA Nodes

        -

        CDATA (MXML_ELEMENT) nodes are created using the mxmlNewCDATA function:

        -
        mxml_node_t *mxmlNewCDATA(mxml_node_t *parent, const char *string);
        -
        -

        The mxmlGetCDATA function retrieves the CDATA string pointer for a node:

        -
        const char *mxmlGetCDATA(mxml_node_t *node);
        -
        -

        Comment Nodes

        -

        Because comments are currently stored as element nodes, comment (MXML_ELEMENT) nodes are created using the mxmlNewElement function by including the surrounding "!--" and "--" characters in the element name, for example:

        -
        mxml_node_t *node = mxmlNewElement("!-- This is a comment --");
        +

        CDATA Nodes

        +

        CDATA (MXML_ELEMENT) nodes are created using the mxmlNewCDATA function:

        +
        mxml_node_t *mxmlNewCDATA(mxml_node_t *parent, const char *string);
        +
        +

        The mxmlGetCDATA function retrieves the CDATA string pointer for a node:

        +
        const char *mxmlGetCDATA(mxml_node_t *node);
        +
        +

        Comment Nodes

        +

        Because comments are currently stored as element nodes, comment (MXML_ELEMENT) nodes are created using the mxmlNewElement function by including the surrounding "!--" and "--" characters in the element name, for example:

        +
        mxml_node_t *node = mxmlNewElement("!-- This is a comment --");
         
        -

        Similarly, the mxmlGetElement function retrieves the comment string pointer for a node, which includes the surrounding "!--" and "--" characters.

        -
        const char *comment = mxmlGetElement(node);
        +

        Similarly, the mxmlGetElement function retrieves the comment string pointer for a node, which includes the surrounding "!--" and "--" characters.

        +
        const char *comment = mxmlGetElement(node);
         /* returns "!-- This is a comment --" */
         
        -

        Processing Instruction Nodes

        -

        Because processing instructions are currently stored as element nodes, processing instruction (MXML_ELEMENT) nodes are created using the mxmlNewElement function including the surrounding "?" characters:

        -
        mxml_node_t *node = mxmlNewElement("?xml-stylesheet type=\"text/css\" href=\"style.css\"?");
        +

        Processing Instruction Nodes

        +

        Because processing instructions are currently stored as element nodes, processing instruction (MXML_ELEMENT) nodes are created using the mxmlNewElement function including the surrounding "?" characters:

        +
        mxml_node_t *node = mxmlNewElement("?xml-stylesheet type=\"text/css\" href=\"style.css\"?");
         
        -

        The mxmlGetElement function retrieves the processing instruction string for a node, including the surrounding "?" characters:

        -
        const char *instr = mxmlGetElement(node);
        +

        The mxmlGetElement function retrieves the processing instruction string for a node, including the surrounding "?" characters:

        +
        const char *instr = mxmlGetElement(node);
         /* returned "?xml-stylesheet type=\"text/css\" href=\"style.css\"?" */
         
        -

        Integer Nodes

        -

        Integer (MXML_INTEGER) nodes are created using the mxmlNewInteger function:

        -
        mxml_node_t *
        +

        Integer Nodes

        +

        Integer (MXML_INTEGER) nodes are created using the mxmlNewInteger function:

        +
        mxml_node_t *
         mxmlNewInteger(mxml_node_t *parent, int integer);
         
        -

        The mxmlGetInteger function retrieves the integer value for a node:

        -
        int
        +

        The mxmlGetInteger function retrieves the integer value for a node:

        +
        int
         mxmlGetInteger(mxml_node_t *node);
         
        -

        Opaque String Nodes

        -

        Opaque string (MXML_OPAQUE) nodes are created using the mxmlNewOpaque function:

        -
        mxml_node_t *
        +

        Opaque String Nodes

        +

        Opaque string (MXML_OPAQUE) nodes are created using the mxmlNewOpaque function:

        +
        mxml_node_t *
         mxmlNewOpaque(mxml_node_t *parent, const char *opaque);
         
        -

        The mxmlGetOpaque function retrieves the opaque string pointer for a node:

        -
        const char *
        +

        The mxmlGetOpaque function retrieves the opaque string pointer for a node:

        +
        const char *
         mxmlGetOpaque(mxml_node_t *node);
         
        -

        Text Nodes

        -

        Whitespace-delimited text string (MXML_TEXT) nodes are created using the mxmlNewText and mxmlNewTextf functions. Each text node consists of a text string and (leading) whitespace flag value.

        -
        mxml_node_t *
        +

        Text Nodes

        +

        Whitespace-delimited text string (MXML_TEXT) nodes are created using the mxmlNewText and mxmlNewTextf functions. Each text node consists of a text string and (leading) whitespace flag value.

        +
        mxml_node_t *
         mxmlNewText(mxml_node_t *parent, int whitespace,
                     const char *string);
         
        @@ -786,39 +806,39 @@
         mxmlNewTextf(mxml_node_t *parent, int whitespace,
                      const char *format, ...);
         
        -

        The mxmlGetText function retrieves the text string pointer and whitespace flag value for a node:

        -
         const char *
        +

        The mxmlGetText function retrieves the text string pointer and whitespace flag value for a node:

        +
         const char *
          mxmlGetText(mxml_node_t *node, int *whitespace);
         
        -

        Real Number Nodes

        -

        Real number (MXML_REAL) nodes are created using the mxmlNewReal function:

        -
        mxml_node_t *
        +

        Real Number Nodes

        +

        Real number (MXML_REAL) nodes are created using the mxmlNewReal function:

        +
        mxml_node_t *
         mxmlNewReal(mxml_node_t *parent, double real);
         
        -

        The mxmlGetReal function retrieves the real number for a node:

        -
        double
        +

        The mxmlGetReal function retrieves the real number for a node:

        +
        double
         mxmlGetReal(mxml_node_t *node);
         
        -

        Locating Data in an XML Document

        -

        Mini-XML provides many functions for enumerating, searching, and indexing XML documents.

        -

        Finding Nodes

        -

        The mxmlFindPath function finds the (first) value node under a specific element using a "path":

        -
        mxml_node_t *
        +

        Locating Data in an XML Document

        +

        Mini-XML provides many functions for enumerating, searching, and indexing XML documents.

        +

        Finding Nodes

        +

        The mxmlFindPath function finds the (first) value node under a specific element using a "path":

        +
        mxml_node_t *
         mxmlFindPath(mxml_node_t *node, const char *path);
         
        -

        The path string can contain the "*" wildcard to match a single element node in the hierarchy. For example, the following code will find the first "node" element under the "group" element, first using an explicit path and then using a wildcard:

        -
        mxml_node_t *value = mxmlFindPath(xml, "data/group/node");
        +

        The path string can contain the "*" wildcard to match a single element node in the hierarchy. For example, the following code will find the first "node" element under the "group" element, first using an explicit path and then using a wildcard:

        +
        mxml_node_t *value = mxmlFindPath(xml, "data/group/node");
         
         mxml_node_t *value = mxmlFindPath(xml, "data/*/node");
         
        -

        The mxmlFindElement function can be used to find a named element, optionally matching an attribute and value:

        -
        mxml_node_t *
        +

        The mxmlFindElement function can be used to find a named element, optionally matching an attribute and value:

        +
        mxml_node_t *
         mxmlFindElement(mxml_node_t *node, mxml_node_t *top,
                         const char *element, const char *attr,
                         const char *value, int descend);
         
        -

        The "element", "attr", and "value" arguments can be passed as NULL to act as wildcards, e.g.:

        -
        /* Find the first "a" element */
        +

        The "element", "attr", and "value" arguments can be passed as NULL to act as wildcards, e.g.:

        +
        /* Find the first "a" element */
         node = mxmlFindElement(tree, tree, "a", NULL, NULL,
                                MXML_DESCEND);
         
        @@ -839,8 +859,8 @@
         node = mxmlFindElement(tree, tree, NULL, "src", "foo.jpg",
                                MXML_DESCEND);
         
        -

        You can also iterate with the same function:

        -
        mxml_node_t *node;
        +

        You can also iterate with the same function:

        +
        mxml_node_t *node;
         
         for (node = mxmlFindElement(tree, tree, "element", NULL,
                                     NULL, MXML_DESCEND);
        @@ -851,18 +871,18 @@
           ... do something ...
         }
         
        -

        The descend argument (MXML_DESCEND in the examples above) can be one of three constants:

        -
          -
        • MXML_NO_DESCEND: ignore child nodes in the element hierarchy, instead using siblings (same level) or parent nodes (above) until the top (root) node is reached.

          +

          The descend argument (MXML_DESCEND in the examples above) can be one of three constants:

          +
            +
          • MXML_NO_DESCEND: ignore child nodes in the element hierarchy, instead using siblings (same level) or parent nodes (above) until the top (root) node is reached.

          • -
          • MXML_DESCEND_FIRST: start the search with the first child of the node, and then search siblings. You'll normally use this when iterating through direct children of a parent node, e.g. all of the "node" and "group" elements under the "?xml" parent node in the previous example.

            +
          • MXML_DESCEND_FIRST: start the search with the first child of the node, and then search siblings. You'll normally use this when iterating through direct children of a parent node, e.g. all of the "node" and "group" elements under the "?xml" parent node in the previous example.

          • -
          • MXML_DESCEND: search child nodes first, then sibling nodes, and then parent nodes.

            +
          • MXML_DESCEND: search child nodes first, then sibling nodes, and then parent nodes.

          -

          Iterating Nodes

          -

          While the mxmlFindNode and mxmlFindPath functions will find a particular element node, sometimes you need to iterate over all nodes. The mxmlWalkNext and mxmlWalkPrev functions can be used to iterate through the XML node tree:

          -
          mxml_node_t *
          +

          Iterating Nodes

          +

          While the mxmlFindNode and mxmlFindPath functions will find a particular element node, sometimes you need to iterate over all nodes. The mxmlWalkNext and mxmlWalkPrev functions can be used to iterate through the XML node tree:

          +
          mxml_node_t *
           mxmlWalkNext(mxml_node_t *node, mxml_node_t *top,
                        int descend);
           
          @@ -870,8 +890,8 @@
           mxmlWalkPrev(mxml_node_t *node, mxml_node_t *top,
                        int descend);
           
          -

          Depending on the value of the descend argument, these functions will automatically traverse child, sibling, and parent nodes until the top node is reached. For example, the following code will iterate over all of the nodes in the sample XML document in the previous section:

          -
          mxml_node_t *node;
          +

          Depending on the value of the descend argument, these functions will automatically traverse child, sibling, and parent nodes until the top node is reached. For example, the following code will iterate over all of the nodes in the sample XML document in the previous section:

          +
          mxml_node_t *node;
           
           for (node = xml;
                node != NULL;
          @@ -880,8 +900,8 @@
             ... do something ...
           }
           
          -

          The nodes will be returned in the following order:

          -
          <?xml version="1.0" encoding="utf-8"?>
          +

          The nodes will be returned in the following order:

          +
          <?xml version="1.0" encoding="utf-8"?>
           <data>
           <node>
           val1
          @@ -901,33 +921,33 @@
           <node>
           val8
           
          -

          Indexing

          -

          The mxmlIndexNew function allows you to create an index of nodes for faster searching and enumeration:

          -
          mxml_index_t *
          +

          Indexing

          +

          The mxmlIndexNew function allows you to create an index of nodes for faster searching and enumeration:

          +
          mxml_index_t *
           mxmlIndexNew(mxml_node_t *node, const char *element,
                        const char *attr);
           
          -

          The element and attr arguments control which elements are included in the index. If element is not NULL then only elements with the specified name are added to the index. Similarly, if attr is not NULL then only elements containing the specified attribute are added to the index. The nodes are sorted in the index.

          -

          For example, the following code creates an index of all "id" values in an XML document:

          -
          mxml_index_t *ind = mxmlIndexNew(xml, NULL, "id");
          +

          The element and attr arguments control which elements are included in the index. If element is not NULL then only elements with the specified name are added to the index. Similarly, if attr is not NULL then only elements containing the specified attribute are added to the index. The nodes are sorted in the index.

          +

          For example, the following code creates an index of all "id" values in an XML document:

          +
          mxml_index_t *ind = mxmlIndexNew(xml, NULL, "id");
           
          -

          Once the index is created, the mxmlIndexFind function can be used to find a matching node:

          -
          mxml_node_t *
          +

          Once the index is created, the mxmlIndexFind function can be used to find a matching node:

          +
          mxml_node_t *
           mxmlIndexFind(mxml_index_t *ind, const char *element,
                         const char *value);
           
          -

          For example, the following code will find the element whose "id" string is "42":

          -
          mxml_node_t *node = mxmlIndexFind(ind, NULL, "42");
          +

          For example, the following code will find the element whose "id" string is "42":

          +
          mxml_node_t *node = mxmlIndexFind(ind, NULL, "42");
           
          -

          Alternately, the mxmlIndexReset and mxmlIndexEnum functions can be used to enumerate the nodes in the index:

          -
          mxml_node_t *
          +

          Alternately, the mxmlIndexReset and mxmlIndexEnum functions can be used to enumerate the nodes in the index:

          +
          mxml_node_t *
           mxmlIndexReset(mxml_index_t *ind);
           
           mxml_node_t *
           mxmlIndexEnum(mxml_index_t *ind);
           
          -

          Typically these functions will be used in a for loop:

          -
          mxml_node_t *node;
          +

          Typically these functions will be used in a for loop:

          +
          mxml_node_t *node;
           
           for (node = mxmlIndexReset(ind);
                node != NULL;
          @@ -936,22 +956,22 @@
             ... do something ...
           }
           
          -

          The mxmlIndexCount function returns the number of nodes in the index:

          -
          int
          +

          The mxmlIndexCount function returns the number of nodes in the index:

          +
          int
           mxmlIndexGetCount(mxml_index_t *ind);
           
          -

          Finally, the mxmlIndexDelete function frees all memory associated with the index:

          -
          void
          +

          Finally, the mxmlIndexDelete function frees all memory associated with the index:

          +
          void
           mxmlIndexDelete(mxml_index_t *ind);
           
          -

          Custom Data Types

          -

          Mini-XML supports custom data types via per-thread load and save callbacks. Only a single set of callbacks can be active at any time for the current thread, however your callbacks can store additional information in order to support multiple custom data types as needed. The MXML_CUSTOM node type identifies custom data nodes.

          -

          The mxmlGetCustom function retrieves the custom value pointer for a node.

          -
          const void *
          +

          Custom Data Types

          +

          Mini-XML supports custom data types via per-thread load and save callbacks. Only a single set of callbacks can be active at any time for the current thread, however your callbacks can store additional information in order to support multiple custom data types as needed. The MXML_CUSTOM node type identifies custom data nodes.

          +

          The mxmlGetCustom function retrieves the custom value pointer for a node.

          +
          const void *
           mxmlGetCustom(mxml_node_t *node);
           
          -

          Custom (MXML_CUSTOM) nodes are created using the mxmlNewCustom function or using a custom per-thread load callbacks specified using the mxmlSetCustomHandlers function:

          -
          typedef void (*mxml_custom_destroy_cb_t)(void *);
          +

          Custom (MXML_CUSTOM) nodes are created using the mxmlNewCustom function or using a custom per-thread load callbacks specified using the mxmlSetCustomHandlers function:

          +
          typedef void (*mxml_custom_destroy_cb_t)(void *);
           typedef int (*mxml_custom_load_cb_t)(mxml_node_t *, const char *);
           typedef char *(*mxml_custom_save_cb_t)(mxml_node_t *);
           
          @@ -967,8 +987,8 @@
           mxmlSetCustomHandlers(mxml_custom_load_cb_t load,
                                 mxml_custom_save_cb_t save);
           
          -

          The load callback receives a pointer to the current data node and a string of opaque character data from the XML source with character entities converted to the corresponding UTF-8 characters. For example, if we wanted to support a custom date/time type whose value is encoded as "yyyy-mm-ddThh:mm:ssZ" (ISO format), the load callback would look like the following:

          -
          typedef struct
          +

          The load callback receives a pointer to the current data node and a string of opaque character data from the XML source with character entities converted to the corresponding UTF-8 characters. For example, if we wanted to support a custom date/time type whose value is encoded as "yyyy-mm-ddThh:mm:ssZ" (ISO format), the load callback would look like the following:

          +
          typedef struct
           {
             unsigned year,    /* Year */
                      month,   /* Month */
          @@ -1055,9 +1075,9 @@
             return (0);
           }
           
          -

          The function itself can return 0 on success or -1 if it is unable to decode the custom data or the data contains an error. Custom data nodes contain a void pointer to the allocated custom data for the node and a pointer to a destructor function which will free the custom data when the node is deleted. In this example, we use the standard free function since everything is contained in a single calloc'd block.

          -

          The save callback receives the node pointer and returns an allocated string containing the custom data value. The following save callback could be used for our ISO date/time type:

          -
          char *
          +

          The function itself can return 0 on success or -1 if it is unable to decode the custom data or the data contains an error. Custom data nodes contain a void pointer to the allocated custom data for the node and a pointer to a destructor function which will free the custom data when the node is deleted. In this example, we use the standard free function since everything is contained in a single calloc'd block.

          +

          The save callback receives the node pointer and returns an allocated string containing the custom data value. The following save callback could be used for our ISO date/time type:

          +
          char *
           save_custom(mxml_node_t *node)
           {
             char data[255];
          @@ -1074,13 +1094,13 @@
             return (strdup(data));
           }
           
          -

          You register the callback functions using the mxmlSetCustomHandlers function:

          -
          mxmlSetCustomHandlers(load_custom, save_custom);
          +

          You register the callback functions using the mxmlSetCustomHandlers function:

          +
          mxmlSetCustomHandlers(load_custom, save_custom);
           
          -

          SAX (Stream) Loading of Documents

          -

          Mini-XML supports an implementation of the Simple API for XML (SAX) which allows you to load and process an XML document as a stream of nodes. Aside from allowing you to process XML documents of any size, the Mini-XML implementation also allows you to retain portions of the document in memory for later processing.

          -

          The mxmlSAXLoadFd, mxmlSAXLoadFile, and mxmlSAXLoadString functions provide the SAX loading APIs:

          -
          mxml_node_t *
          +

          SAX (Stream) Loading of Documents

          +

          Mini-XML supports an implementation of the Simple API for XML (SAX) which allows you to load and process an XML document as a stream of nodes. Aside from allowing you to process XML documents of any size, the Mini-XML implementation also allows you to retain portions of the document in memory for later processing.

          +

          The mxmlSAXLoadFd, mxmlSAXLoadFile, and mxmlSAXLoadString functions provide the SAX loading APIs:

          +
          mxml_node_t *
           mxmlSAXLoadFd(mxml_node_t *top, int fd,
                         mxml_type_t (*cb)(mxml_node_t *),
                         mxml_sax_cb_t sax, void *sax_data);
          @@ -1095,31 +1115,31 @@
                             mxml_type_t (*cb)(mxml_node_t *),
                             mxml_sax_cb_t sax, void *sax_data);
           
          -

          Each function works like the corresponding mxmlLoad function but uses a callback to process each node as it is read. The callback function receives the node, an event code, and a user data pointer you supply:

          -
          void
          +

          Each function works like the corresponding mxmlLoad function but uses a callback to process each node as it is read. The callback function receives the node, an event code, and a user data pointer you supply:

          +
          void
           sax_cb(mxml_node_t *node, mxml_sax_event_t event,
                  void *data)
           {
             ... do something ...
           }
           
          -

          The event will be one of the following:

          -
            -
          • MXML_SAX_CDATA: CDATA was just read.

            +

            The event will be one of the following:

            +
              +
            • MXML_SAX_CDATA: CDATA was just read.

            • -
            • MXML_SAX_COMMENT: A comment was just read.

              +
            • MXML_SAX_COMMENT: A comment was just read.

            • -
            • MXML_SAX_DATA: Data (custom, integer, opaque, real, or text) was just read.

              +
            • MXML_SAX_DATA: Data (custom, integer, opaque, real, or text) was just read.

            • -
            • MXML_SAX_DIRECTIVE: A processing directive/instruction was just read.

              +
            • MXML_SAX_DIRECTIVE: A processing directive/instruction was just read.

            • -
            • MXML_SAX_ELEMENT_CLOSE - A close element was just read (</element>)

              +
            • MXML_SAX_ELEMENT_CLOSE - A close element was just read (</element>)

            • -
            • MXML_SAX_ELEMENT_OPEN - An open element was just read (<element>)

              +
            • MXML_SAX_ELEMENT_OPEN - An open element was just read (<element>)

            -

            Elements are released after the close element is processed. All other nodes are released after they are processed. The SAX callback can retain the node using the mxmlRetain function. For example, the following SAX callback will retain all nodes, effectively simulating a normal in-memory load:

            -
            void
            +

            Elements are released after the close element is processed. All other nodes are released after they are processed. The SAX callback can retain the node using the mxmlRetain function. For example, the following SAX callback will retain all nodes, effectively simulating a normal in-memory load:

            +
            void
             sax_cb(mxml_node_t *node, mxml_sax_event_t event,
                    void *data)
             {
            @@ -1127,8 +1147,8 @@
                 mxmlRetain(node);
             }
             
            -

            More typically the SAX callback will only retain a small portion of the document that is needed for post-processing. For example, the following SAX callback will retain the title and headings in an XHTML file. It also retains the (parent) elements like <html>, <head>, and <body>, and processing directives like <?xml ... ?> and <!DOCTYPE ... >:

            -
            void
            +

            More typically the SAX callback will only retain a small portion of the document that is needed for post-processing. For example, the following SAX callback will retain the title and headings in an XHTML file. It also retains the (parent) elements like <html>, <head>, and <body>, and processing directives like <?xml ... ?> and <!DOCTYPE ... >:

            +
            void
             sax_cb(mxml_node_t *node, mxml_sax_event_t event,
                    void *data)
             {
            @@ -1168,8 +1188,8 @@
               }
             }
             
            -

            The resulting skeleton document tree can then be searched just like one loaded using the mxmlLoad functions. For example, a filter that reads an XHTML document from stdin and then shows the title and headings in the document would look like:

            -
            mxml_node_t *doc, *title, *body, *heading;
            +

            The resulting skeleton document tree can then be searched just like one loaded using the mxmlLoad functions. For example, a filter that reads an XHTML document from stdin and then shows the title and headings in the document would look like:

            +
            mxml_node_t *doc, *title, *body, *heading;
             
             doc = mxmlSAXLoadFd(NULL, 0, MXML_TEXT_CALLBACK, sax_cb,
                                 NULL);
            @@ -1191,8 +1211,8 @@
                 print_children(heading);
             }
             
            -

            The print_children function is:

            -
            void
            +

            The print_children function is:

            +
            void
             print_children(mxml_node_t *parent)
             {
               mxml_node_t *node;
            @@ -1214,209 +1234,209 @@
               putchar('\n');
             }
             
            -

            Functions

            +

            Functions

            mxmlAdd

            -

            Add a node to a tree.

            +

            Add a node to a tree.

            void mxmlAdd(mxml_node_t *parent, int where, mxml_node_t *child, mxml_node_t *node);

            Parameters

            - + - + - + - +
            parentParent node
            Parent node
            whereWhere to add, MXML_ADD_BEFORE or MXML_ADD_AFTER
            Where to add, MXML_ADD_BEFORE or MXML_ADD_AFTER
            childChild node for where or MXML_ADD_TO_PARENT
            Child node for where or MXML_ADD_TO_PARENT
            nodeNode to add
            Node to add

            Discussion

            -

            Adds the specified node to the parent. If the child argument is not +

            Adds the specified node to the parent. If the child argument is not NULL, puts the new node before or after the specified child depending on the value of the where argument. If the child argument is NULL, puts the new node at the beginning of the child list (MXML_ADD_BEFORE) or at the end of the child list (MXML_ADD_AFTER). The constant MXML_ADD_TO_PARENT can be used to specify a NULL child pointer.

            mxmlDelete

            -

            Delete a node and all of its children.

            +

            Delete a node and all of its children.

            void mxmlDelete(mxml_node_t *node);

            Parameters

            - +
            nodeNode to delete
            Node to delete

            Discussion

            -

            If the specified node has a parent, this function first removes the +

            If the specified node has a parent, this function first removes the node from its parent using the mxmlRemove function.

             Mini-XML 2.4 mxmlElementDeleteAttr

            -

            Delete an attribute.

            +

            Delete an attribute.

            void mxmlElementDeleteAttr(mxml_node_t *node, const char *name);

            Parameters

            - + - +
            nodeElement
            Element
            nameAttribute name
            Attribute name

            mxmlElementGetAttr

            -

            Get an attribute.

            +

            Get an attribute.

            const char *mxmlElementGetAttr(mxml_node_t *node, const char *name);

            Parameters

            - + - +
            nodeElement node
            Element node
            nameName of attribute
            Name of attribute

            Return Value

            -

            Attribute value or NULL

            +

            Attribute value or NULL

            Discussion

            -

            This function returns NULL if the node is not an element or the +

            This function returns NULL if the node is not an element or the named attribute does not exist.

             Mini-XML 2.11 mxmlElementGetAttrByIndex

            -

            Get an element attribute by index.

            +

            Get an element attribute by index.

            const char *mxmlElementGetAttrByIndex(mxml_node_t *node, int idx, const char **name);

            Parameters

            - + - + - +
            nodeNode
            Node
            idxAttribute index, starting at 0
            Attribute index, starting at 0
            nameAttribute name
            Attribute name

            Return Value

            -

            Attribute value

            +

            Attribute value

            Discussion

            -

            The index ("idx") is 0-based. NULL is returned if the specified index +

            The index ("idx") is 0-based. NULL is returned if the specified index is out of range.

             Mini-XML 2.11 mxmlElementGetAttrCount

            -

            Get the number of element attributes.

            +

            Get the number of element attributes.

            int mxmlElementGetAttrCount(mxml_node_t *node);

            Parameters

            - +
            nodeNode
            Node

            Return Value

            -

            Number of attributes

            +

            Number of attributes

            mxmlElementSetAttr

            -

            Set an attribute.

            +

            Set an attribute.

            void mxmlElementSetAttr(mxml_node_t *node, const char *name, const char *value);

            Parameters

            - + - + - +
            nodeElement node
            Element node
            nameName of attribute
            Name of attribute
            valueAttribute value
            Attribute value

            Discussion

            -

            If the named attribute already exists, the value of the attribute +

            If the named attribute already exists, the value of the attribute is replaced by the new string value. The string value is copied into the element node. This function does nothing if the node is not an element.

             Mini-XML 2.3 mxmlElementSetAttrf

            -

            Set an attribute with a formatted value.

            +

            Set an attribute with a formatted value.

            void mxmlElementSetAttrf(mxml_node_t *node, const char *name, const char *format, ...);

            Parameters

            - + - + - + - +
            nodeElement node
            Element node
            nameName of attribute
            Name of attribute
            formatPrintf-style attribute value
            Printf-style attribute value
            ...Additional arguments as needed
            Additional arguments as needed

            Discussion

            -

            If the named attribute already exists, the value of the attribute +

            If the named attribute already exists, the value of the attribute is replaced by the new formatted string. The formatted string value is copied into the element node. This function does nothing if the node is not an element.

            mxmlEntityAddCallback

            -

            Add a callback to convert entities to Unicode.

            +

            Add a callback to convert entities to Unicode.

            int mxmlEntityAddCallback(mxml_entity_cb_t cb);

            Parameters

            - +
            cbCallback function to add
            Callback function to add

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            mxmlEntityGetName

            -

            Get the name that corresponds to the character value.

            +

            Get the name that corresponds to the character value.

            const char *mxmlEntityGetName(int val);

            Parameters

            - +
            valCharacter value
            Character value

            Return Value

            -

            Entity name or NULL

            +

            Entity name or NULL

            Discussion

            -

            If val does not need to be represented by a named entity, NULL is returned.

            +

            If val does not need to be represented by a named entity, NULL is returned.

            mxmlEntityGetValue

            -

            Get the character corresponding to a named entity.

            +

            Get the character corresponding to a named entity.

            int mxmlEntityGetValue(const char *name);

            Parameters

            - +
            nameEntity name
            Entity name

            Return Value

            -

            Character value or -1 on error

            +

            Character value or -1 on error

            Discussion

            -

            The entity name can also be a numeric constant. -1 is returned if the +

            The entity name can also be a numeric constant. -1 is returned if the name is not known.

            mxmlEntityRemoveCallback

            -

            Remove a callback.

            +

            Remove a callback.

            void mxmlEntityRemoveCallback(mxml_entity_cb_t cb);

            Parameters

            - +
            cbCallback function to remove
            Callback function to remove

            mxmlFindElement

            -

            Find the named element.

            +

            Find the named element.

            mxml_node_t *mxmlFindElement(mxml_node_t *node, mxml_node_t *top, const char *element, const char *attr, const char *value, int descend);

            Parameters

            - + - + - + - + - + - +
            nodeCurrent node
            Current node
            topTop node
            Top node
            elementElement name or NULL for any
            Element name or NULL for any
            attrAttribute name, or NULL for none
            Attribute name, or NULL for none
            valueAttribute value, or NULL for any
            Attribute value, or NULL for any
            descendDescend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST
            Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST

            Return Value

            -

            Element node or NULL

            +

            Element node or NULL

            Discussion

            -

            The search is constrained by the name, attribute name, and value; any +

            The search is constrained by the name, attribute name, and value; any NULL names or values are treated as wildcards, so different kinds of searches can be implemented by looking for all elements of a given name or all elements with a specific attribute. The descend argument determines @@ -1425,20 +1445,20 @@ to find additional direct descendents of the node. The top node argument constrains the search to a particular node's children.

             Mini-XML 2.7 mxmlFindPath

            -

            Find a node with the given path.

            +

            Find a node with the given path.

            mxml_node_t *mxmlFindPath(mxml_node_t *top, const char *path);

            Parameters

            - + - +
            topTop node
            Top node
            pathPath to element
            Path to element

            Return Value

            -

            Found node or NULL

            +

            Found node or NULL

            Discussion

            -

            The "path" is a slash-separated list of element names. The name "" is +

            The "path" is a slash-separated list of element names. The name "" is considered a wildcard for one or more levels of elements. For example, "foo/one/two", "bar/two/one", "/one", and so forth.

            @@ -1447,206 +1467,206 @@

             Mini-XML 2.7 mxmlGetCDATA

            -

            Get the value for a CDATA node.

            +

            Get the value for a CDATA node.

            const char *mxmlGetCDATA(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            CDATA value or NULL

            +

            CDATA value or NULL

            Discussion

            -

            NULL is returned if the node is not a CDATA element. +

            NULL is returned if the node is not a CDATA element.

             Mini-XML 2.7 mxmlGetCustom

            -

            Get the value for a custom node.

            +

            Get the value for a custom node.

            const void *mxmlGetCustom(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Custom value or NULL

            +

            Custom value or NULL

            Discussion

            -

            NULL is returned if the node (or its first child) is not a custom +

            NULL is returned if the node (or its first child) is not a custom value node.

             Mini-XML 2.7 mxmlGetElement

            -

            Get the name for an element node.

            +

            Get the name for an element node.

            const char *mxmlGetElement(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Element name or NULL

            +

            Element name or NULL

            Discussion

            -

            NULL is returned if the node is not an element node. +

            NULL is returned if the node is not an element node.

             Mini-XML 2.7 mxmlGetFirstChild

            -

            Get the first child of an element node.

            +

            Get the first child of an element node.

            mxml_node_t *mxmlGetFirstChild(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            First child or NULL

            +

            First child or NULL

            Discussion

            -

            NULL is returned if the node is not an element node or if the node +

            NULL is returned if the node is not an element node or if the node has no children.

             Mini-XML 2.7 mxmlGetInteger

            -

            Get the integer value from the specified node or its +

            Get the integer value from the specified node or its first child.

            int mxmlGetInteger(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Integer value or 0

            +

            Integer value or 0

            Discussion

            -

            0 is returned if the node (or its first child) is not an integer value node. +

            0 is returned if the node (or its first child) is not an integer value node.

             Mini-XML 2.7 mxmlGetLastChild

            -

            Get the last child of an element node.

            +

            Get the last child of an element node.

            mxml_node_t *mxmlGetLastChild(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Last child or NULL

            +

            Last child or NULL

            Discussion

            -

            NULL is returned if the node is not an element node or if the node +

            NULL is returned if the node is not an element node or if the node has no children.

            mxmlGetNextSibling

            -

            +

            mxml_node_t *mxmlGetNextSibling(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Get the next node for the current parent.

            -

            NULL is returned if this is the last child for the current parent. +

            Get the next node for the current parent.

            +

            NULL is returned if this is the last child for the current parent.

             Mini-XML 2.7 mxmlGetOpaque

            -

            Get an opaque string value for a node or its first child.

            +

            Get an opaque string value for a node or its first child.

            const char *mxmlGetOpaque(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Opaque string or NULL

            +

            Opaque string or NULL

            Discussion

            -

            NULL is returned if the node (or its first child) is not an opaque +

            NULL is returned if the node (or its first child) is not an opaque value node.

             Mini-XML 2.7 mxmlGetParent

            -

            Get the parent node.

            +

            Get the parent node.

            mxml_node_t *mxmlGetParent(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Parent node or NULL

            +

            Parent node or NULL

            Discussion

            -

            NULL is returned for a root node. +

            NULL is returned for a root node.

             Mini-XML 2.7 mxmlGetPrevSibling

            -

            Get the previous node for the current parent.

            +

            Get the previous node for the current parent.

            mxml_node_t *mxmlGetPrevSibling(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Previous node or NULL

            +

            Previous node or NULL

            Discussion

            -

            NULL is returned if this is the first child for the current parent. +

            NULL is returned if this is the first child for the current parent.

             Mini-XML 2.7 mxmlGetReal

            -

            Get the real value for a node or its first child.

            +

            Get the real value for a node or its first child.

            double mxmlGetReal(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Real value or 0.0

            +

            Real value or 0.0

            Discussion

            -

            0.0 is returned if the node (or its first child) is not a real value node. +

            0.0 is returned if the node (or its first child) is not a real value node.

             Mini-XML 2.7 mxmlGetRefCount

            -

            Get the current reference (use) count for a node.

            +

            Get the current reference (use) count for a node.

            int mxmlGetRefCount(mxml_node_t *node);

            Parameters

            - +
            nodeNode
            Node

            Return Value

            -

            Reference count

            +

            Reference count

            Discussion

            -

            The initial reference count of new nodes is 1. Use the mxmlRetain +

            The initial reference count of new nodes is 1. Use the mxmlRetain and mxmlRelease functions to increment and decrement a node's reference count. .

             Mini-XML 2.7 mxmlGetText

            -

            Get the text value for a node or its first child.

            +

            Get the text value for a node or its first child.

            const char *mxmlGetText(mxml_node_t *node, int *whitespace);

            Parameters

            - + - +
            nodeNode to get
            Node to get
            whitespace1 if string is preceded by whitespace, 0 otherwise
            1 if string is preceded by whitespace, 0 otherwise

            Return Value

            -

            Text string or NULL

            +

            Text string or NULL

            Discussion

            -

            NULL is returned if the node (or its first child) is not a text node. +

            NULL is returned if the node (or its first child) is not a text node. The "whitespace" argument can be NULL.

            Note: Text nodes consist of whitespace-delimited words. You will only get @@ -1657,139 +1677,139 @@

             Mini-XML 2.7 mxmlGetType

            -

            Get the node type.

            +

            Get the node type.

            mxml_type_t mxmlGetType(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            Type of node

            +

            Type of node

            Discussion

            -

            MXML_IGNORE is returned if "node" is NULL. +

            MXML_IGNORE is returned if "node" is NULL.

             Mini-XML 2.7 mxmlGetUserData

            -

            Get the user data pointer for a node.

            +

            Get the user data pointer for a node.

            void *mxmlGetUserData(mxml_node_t *node);

            Parameters

            - +
            nodeNode to get
            Node to get

            Return Value

            -

            User data pointer

            +

            User data pointer

            mxmlIndexDelete

            -

            Delete an index.

            +

            Delete an index.

            void mxmlIndexDelete(mxml_index_t *ind);

            Parameters

            - +
            indIndex to delete
            Index to delete

            mxmlIndexEnum

            -

            Return the next node in the index.

            +

            Return the next node in the index.

            mxml_node_t *mxmlIndexEnum(mxml_index_t *ind);

            Parameters

            - +
            indIndex to enumerate
            Index to enumerate

            Return Value

            -

            Next node or NULL if there is none

            +

            Next node or NULL if there is none

            Discussion

            -

            You should call mxmlIndexReset prior to using this function to get +

            You should call mxmlIndexReset prior to using this function to get the first node in the index. Nodes are returned in the sorted order of the index.

            mxmlIndexFind

            -

            Find the next matching node.

            +

            Find the next matching node.

            mxml_node_t *mxmlIndexFind(mxml_index_t *ind, const char *element, const char *value);

            Parameters

            - + - + - +
            indIndex to search
            Index to search
            elementElement name to find, if any
            Element name to find, if any
            valueAttribute value, if any
            Attribute value, if any

            Return Value

            -

            Node or NULL if none found

            +

            Node or NULL if none found

            Discussion

            -

            You should call mxmlIndexReset prior to using this function for +

            You should call mxmlIndexReset prior to using this function for the first time with a particular set of "element" and "value" strings. Passing NULL for both "element" and "value" is equivalent to calling mxmlIndexEnum.

             Mini-XML 2.7 mxmlIndexGetCount

            -

            Get the number of nodes in an index.

            +

            Get the number of nodes in an index.

            int mxmlIndexGetCount(mxml_index_t *ind);

            Parameters

            - +
            indIndex of nodes
            Index of nodes

            Return Value

            -

            Number of nodes in index

            +

            Number of nodes in index

            mxmlIndexNew

            -

            Create a new index.

            +

            Create a new index.

            mxml_index_t *mxmlIndexNew(mxml_node_t *node, const char *element, const char *attr);

            Parameters

            - + - + - +
            nodeXML node tree
            XML node tree
            elementElement to index or NULL for all
            Element to index or NULL for all
            attrAttribute to index or NULL for none
            Attribute to index or NULL for none

            Return Value

            -

            New index

            +

            New index

            Discussion

            -

            The index will contain all nodes that contain the named element and/or +

            The index will contain all nodes that contain the named element and/or attribute. If both "element" and "attr" are NULL, then the index will contain a sorted list of the elements in the node tree. Nodes are sorted by element name and optionally by attribute value if the "attr" argument is not NULL.

            mxmlIndexReset

            -

            Reset the enumeration/find pointer in the index and +

            Reset the enumeration/find pointer in the index and return the first node in the index.

            mxml_node_t *mxmlIndexReset(mxml_index_t *ind);

            Parameters

            - +
            indIndex to reset
            Index to reset

            Return Value

            -

            First node or NULL if there is none

            +

            First node or NULL if there is none

            Discussion

            -

            This function should be called prior to using mxmlIndexEnum or +

            This function should be called prior to using mxmlIndexEnum or mxmlIndexFind for the first time.

            mxmlLoadFd

            -

            Load a file descriptor into an XML node tree.

            +

            Load a file descriptor into an XML node tree.

            mxml_node_t *mxmlLoadFd(mxml_node_t *top, int fd, mxml_load_cb_t cb);

            Parameters

            - + - + - +
            topTop node
            Top node
            fdFile descriptor to read from
            File descriptor to read from
            cbCallback function or constant
            Callback function or constant

            Return Value

            -

            First node or NULL if the file could not be read.

            +

            First node or NULL if the file could not be read.

            Discussion

            -

            The nodes in the specified file are added to the specified top node. +

            The nodes in the specified file are added to the specified top node. If no top node is provided, the XML file MUST be well-formed with a single parent node like ?xml for the entire file. The callback function returns the value type that should be used for child nodes. @@ -1803,22 +1823,22 @@ MXML_OPAQUE_CALLBACK which returns the inline text as a single string (including whitespace).

            mxmlLoadFile

            -

            Load a file into an XML node tree.

            +

            Load a file into an XML node tree.

            mxml_node_t *mxmlLoadFile(mxml_node_t *top, FILE *fp, mxml_load_cb_t cb);

            Parameters

            - + - + - +
            topTop node
            Top node
            fpFile to read from
            File to read from
            cbCallback function or constant
            Callback function or constant

            Return Value

            -

            First node or NULL if the file could not be read.

            +

            First node or NULL if the file could not be read.

            Discussion

            -

            The nodes in the specified file are added to the specified top node. +

            The nodes in the specified file are added to the specified top node. If no top node is provided, the XML file MUST be well-formed with a single parent node like ?xml for the entire file. The callback function returns the value type that should be used for child nodes. @@ -1832,22 +1852,22 @@ MXML_OPAQUE_CALLBACK which returns the inline text as a single string (including whitespace).

            mxmlLoadString

            -

            Load a string into an XML node tree.

            +

            Load a string into an XML node tree.

            mxml_node_t *mxmlLoadString(mxml_node_t *top, const char *s, mxml_load_cb_t cb);

            Parameters

            - + - + - +
            topTop node
            Top node
            sString to load
            String to load
            cbCallback function or constant
            Callback function or constant

            Return Value

            -

            First node or NULL if the string has errors.

            +

            First node or NULL if the string has errors.

            Discussion

            -

            The nodes in the specified string are added to the specified top node. +

            The nodes in the specified string are added to the specified top node. If no top node is provided, the XML string MUST be well-formed with a single parent node like ?xml for the entire string. The callback function returns the value type that should be used for child nodes. @@ -1861,20 +1881,20 @@ MXML_OPAQUE_CALLBACK which returns the inline text as a single string (including whitespace).

             Mini-XML 2.3 mxmlNewCDATA

            -

            Create a new CDATA node.

            +

            Create a new CDATA node.

            mxml_node_t *mxmlNewCDATA(mxml_node_t *parent, const char *data);

            Parameters

            - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            dataData string
            Data string

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new CDATA node is added to the end of the specified parent's child +

            The new CDATA node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new CDATA node has no parent. The data string must be nul-terminated and is copied into the new node. CDATA nodes currently use the @@ -1882,237 +1902,237 @@

             Mini-XML 2.1 mxmlNewCustom

            -

            Create a new custom data node.

            +

            Create a new custom data node.

            mxml_node_t *mxmlNewCustom(mxml_node_t *parent, void *data, mxml_custom_destroy_cb_t destroy);

            Parameters

            - + - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            dataPointer to data
            Pointer to data
            destroyFunction to destroy data
            Function to destroy data

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new custom node is added to the end of the specified parent's child +

            The new custom node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new element node has no parent. NULL can be passed when the data in the node is not dynamically allocated or is separately managed.

            mxmlNewElement

            -

            Create a new element node.

            +

            Create a new element node.

            mxml_node_t *mxmlNewElement(mxml_node_t *parent, const char *name);

            Parameters

            - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            nameName of element
            Name of element

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new element node is added to the end of the specified parent's child +

            The new element node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new element node has no parent.

            mxmlNewInteger

            -

            Create a new integer node.

            +

            Create a new integer node.

            mxml_node_t *mxmlNewInteger(mxml_node_t *parent, int integer);

            Parameters

            - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            integerInteger value
            Integer value

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new integer node is added to the end of the specified parent's child +

            The new integer node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new integer node has no parent.

            mxmlNewOpaque

            -

            Create a new opaque string.

            +

            Create a new opaque string.

            mxml_node_t *mxmlNewOpaque(mxml_node_t *parent, const char *opaque);

            Parameters

            - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            opaqueOpaque string
            Opaque string

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new opaque string node is added to the end of the specified parent's +

            The new opaque string node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new opaque string node has no parent. The opaque string must be nul- terminated and is copied into the new node.

            mxmlNewOpaquef

            -

            Create a new formatted opaque string node.

            +

            Create a new formatted opaque string node.

            mxml_node_t *mxmlNewOpaquef(mxml_node_t *parent, const char *format, ...);

            Parameters

            - + - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            formatPrintf-style format string
            Printf-style format string
            ...Additional args as needed
            Additional args as needed

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new opaque string node is added to the end of the specified parent's +

            The new opaque string node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new opaque string node has no parent. The format string must be nul-terminated and is formatted into the new node.

            mxmlNewReal

            -

            Create a new real number node.

            +

            Create a new real number node.

            mxml_node_t *mxmlNewReal(mxml_node_t *parent, double real);

            Parameters

            - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            realReal number value
            Real number value

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new real number node is added to the end of the specified parent's +

            The new real number node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new real number node has no parent.

            mxmlNewText

            -

            Create a new text fragment node.

            +

            Create a new text fragment node.

            mxml_node_t *mxmlNewText(mxml_node_t *parent, int whitespace, const char *string);

            Parameters

            - + - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            whitespace1 = leading whitespace, 0 = no whitespace
            1 = leading whitespace, 0 = no whitespace
            stringString
            String

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new text node is added to the end of the specified parent's child +

            The new text node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new text node has no parent. The whitespace parameter is used to specify whether leading whitespace is present before the node. The text string must be nul-terminated and is copied into the new node.

            mxmlNewTextf

            -

            Create a new formatted text fragment node.

            +

            Create a new formatted text fragment node.

            mxml_node_t *mxmlNewTextf(mxml_node_t *parent, int whitespace, const char *format, ...);

            Parameters

            - + - + - + - +
            parentParent node or MXML_NO_PARENT
            Parent node or MXML_NO_PARENT
            whitespace1 = leading whitespace, 0 = no whitespace
            1 = leading whitespace, 0 = no whitespace
            formatPrintf-style format string
            Printf-style format string
            ...Additional args as needed
            Additional args as needed

            Return Value

            -

            New node

            +

            New node

            Discussion

            -

            The new text node is added to the end of the specified parent's child +

            The new text node is added to the end of the specified parent's child list. The constant MXML_NO_PARENT can be used to specify that the new text node has no parent. The whitespace parameter is used to specify whether leading whitespace is present before the node. The format string must be nul-terminated and is formatted into the new node.

             Mini-XML 2.3 mxmlNewXML

            -

            Create a new XML document tree.

            +

            Create a new XML document tree.

            mxml_node_t *mxmlNewXML(const char *version);

            Parameters

            - +
            versionVersion number to use
            Version number to use

            Return Value

            -

            New ?xml node

            +

            New ?xml node

            Discussion

            -

            The "version" argument specifies the version number to put in the +

            The "version" argument specifies the version number to put in the ?xml element node. If NULL, version "1.0" is assumed.

             Mini-XML 2.3 mxmlRelease

            -

            Release a node.

            +

            Release a node.

            int mxmlRelease(mxml_node_t *node);

            Parameters

            - +
            nodeNode
            Node

            Return Value

            -

            New reference count

            +

            New reference count

            Discussion

            -

            When the reference count reaches zero, the node (and any children) +

            When the reference count reaches zero, the node (and any children) is deleted via mxmlDelete.

            mxmlRemove

            -

            Remove a node from its parent.

            +

            Remove a node from its parent.

            void mxmlRemove(mxml_node_t *node);

            Parameters

            - +
            nodeNode to remove
            Node to remove

            Discussion

            -

            This function does not free memory used by the node - use mxmlDelete +

            This function does not free memory used by the node - use mxmlDelete for that. This function does nothing if the node has no parent.

             Mini-XML 2.3 mxmlRetain

            -

            Retain a node.

            +

            Retain a node.

            int mxmlRetain(mxml_node_t *node);

            Parameters

            - +
            nodeNode
            Node

            Return Value

            -

            New reference count

            +

            New reference count

             Mini-XML 2.3 mxmlSAXLoadFd

            -

            Load a file descriptor into an XML node tree +

            Load a file descriptor into an XML node tree using a SAX callback.

            mxml_node_t *mxmlSAXLoadFd(mxml_node_t *top, int fd, mxml_load_cb_t cb, mxml_sax_cb_t sax_cb, void *sax_data);

            Parameters

            - + - + - + - + - +
            topTop node
            Top node
            fdFile descriptor to read from
            File descriptor to read from
            cbCallback function or constant
            Callback function or constant
            sax_cbSAX callback or MXML_NO_CALLBACK
            SAX callback or MXML_NO_CALLBACK
            sax_dataSAX user data
            SAX user data

            Return Value

            -

            First node or NULL if the file could not be read.

            +

            First node or NULL if the file could not be read.

            Discussion

            -

            The nodes in the specified file are added to the specified top node. +

            The nodes in the specified file are added to the specified top node. If no top node is provided, the XML file MUST be well-formed with a single parent node like ?xml for the entire file. The callback function returns the value type that should be used for child nodes. @@ -2126,27 +2146,27 @@

             Mini-XML 2.3 mxmlSAXLoadFile

            -

            Load a file into an XML node tree +

            Load a file into an XML node tree using a SAX callback.

            mxml_node_t *mxmlSAXLoadFile(mxml_node_t *top, FILE *fp, mxml_load_cb_t cb, mxml_sax_cb_t sax_cb, void *sax_data);

            Parameters

            - + - + - + - + - +
            topTop node
            Top node
            fpFile to read from
            File to read from
            cbCallback function or constant
            Callback function or constant
            sax_cbSAX callback or MXML_NO_CALLBACK
            SAX callback or MXML_NO_CALLBACK
            sax_dataSAX user data
            SAX user data

            Return Value

            -

            First node or NULL if the file could not be read.

            +

            First node or NULL if the file could not be read.

            Discussion

            -

            The nodes in the specified file are added to the specified top node. +

            The nodes in the specified file are added to the specified top node. If no top node is provided, the XML file MUST be well-formed with a single parent node like ?xml for the entire file. The callback function returns the value type that should be used for child nodes. @@ -2160,27 +2180,27 @@

             Mini-XML 2.3 mxmlSAXLoadString

            -

            Load a string into an XML node tree +

            Load a string into an XML node tree using a SAX callback.

            mxml_node_t *mxmlSAXLoadString(mxml_node_t *top, const char *s, mxml_load_cb_t cb, mxml_sax_cb_t sax_cb, void *sax_data);

            Parameters

            - + - + - + - + - +
            topTop node
            Top node
            sString to load
            String to load
            cbCallback function or constant
            Callback function or constant
            sax_cbSAX callback or MXML_NO_CALLBACK
            SAX callback or MXML_NO_CALLBACK
            sax_dataSAX user data
            SAX user data

            Return Value

            -

            First node or NULL if the string has errors.

            +

            First node or NULL if the string has errors.

            Discussion

            -

            The nodes in the specified string are added to the specified top node. +

            The nodes in the specified string are added to the specified top node. If no top node is provided, the XML string MUST be well-formed with a single parent node like ?xml for the entire string. The callback function returns the value type that should be used for child nodes. @@ -2194,91 +2214,90 @@

            mxmlSaveAllocString

            -

            Save an XML tree to an allocated string.

            +

            Save an XML tree to an allocated string.

            char *mxmlSaveAllocString(mxml_node_t *node, mxml_save_cb_t cb);

            Parameters

            - + - +
            nodeNode to write
            Node to write
            cbWhitespace callback or MXML_NO_CALLBACK
            Whitespace callback or MXML_NO_CALLBACK

            Return Value

            -

            Allocated string or NULL

            +

            Allocated string or NULL

            Discussion

            -

            This function returns a pointer to a string containing the textual +

            This function returns a pointer to a string containing the textual representation of the XML node tree. The string should be freed -using the free() function when you are done with it. NULL is returned -if the node would produce an empty string or if the string cannot be -allocated.
            +using free() when you are done with it. NULL is returned if the node +would produce an empty string or if the string cannot be allocated.

            The callback argument specifies a function that returns a whitespace -string or NULL before and after each element. If MXML_NO_CALLBACK +string or NULL before and after each element. If MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_TEXT nodes with leading whitespace and before attribute names inside opening element tags.

            mxmlSaveFd

            -

            Save an XML tree to a file descriptor.

            +

            Save an XML tree to a file descriptor.

            int mxmlSaveFd(mxml_node_t *node, int fd, mxml_save_cb_t cb);

            Parameters

            - + - + - +
            nodeNode to write
            Node to write
            fdFile descriptor to write to
            File descriptor to write to
            cbWhitespace callback or MXML_NO_CALLBACK
            Whitespace callback or MXML_NO_CALLBACK

            Return Value

            -

            0 on success, -1 on error.

            +

            0 on success, -1 on error.

            Discussion

            -

            The callback argument specifies a function that returns a whitespace +

            The callback argument specifies a function that returns a whitespace string or NULL before and after each element. If MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_TEXT nodes with leading whitespace and before attribute names inside opening element tags.

            mxmlSaveFile

            -

            Save an XML tree to a file.

            +

            Save an XML tree to a file.

            int mxmlSaveFile(mxml_node_t *node, FILE *fp, mxml_save_cb_t cb);

            Parameters

            - + - + - +
            nodeNode to write
            Node to write
            fpFile to write to
            File to write to
            cbWhitespace callback or MXML_NO_CALLBACK
            Whitespace callback or MXML_NO_CALLBACK

            Return Value

            -

            0 on success, -1 on error.

            +

            0 on success, -1 on error.

            Discussion

            -

            The callback argument specifies a function that returns a whitespace +

            The callback argument specifies a function that returns a whitespace string or NULL before and after each element. If MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_TEXT nodes with leading whitespace and before attribute names inside opening element tags.

            mxmlSaveString

            -

            Save an XML node tree to a string.

            +

            Save an XML node tree to a string.

            int mxmlSaveString(mxml_node_t *node, char *buffer, int bufsize, mxml_save_cb_t cb);

            Parameters

            - + - + - + - +
            nodeNode to write
            Node to write
            bufferString buffer
            String buffer
            bufsizeSize of string buffer
            Size of string buffer
            cbWhitespace callback or MXML_NO_CALLBACK
            Whitespace callback or MXML_NO_CALLBACK

            Return Value

            -

            Size of string

            +

            Size of string

            Discussion

            -

            This function returns the total number of bytes that would be +

            This function returns the total number of bytes that would be required for the string but only copies (bufsize - 1) characters into the specified buffer.

            @@ -2288,331 +2307,331 @@ with leading whitespace and before attribute names inside opening element tags.

             Mini-XML 2.3 mxmlSetCDATA

            -

            Set the element name of a CDATA node.

            +

            Set the element name of a CDATA node.

            int mxmlSetCDATA(mxml_node_t *node, const char *data);

            Parameters

            - + - +
            nodeNode to set
            Node to set
            dataNew data string
            New data string

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not a CDATA element node. +

            The node is not changed if it (or its first child) is not a CDATA element node.

             Mini-XML 2.1 mxmlSetCustom

            -

            Set the data and destructor of a custom data node.

            +

            Set the data and destructor of a custom data node.

            int mxmlSetCustom(mxml_node_t *node, void *data, mxml_custom_destroy_cb_t destroy);

            Parameters

            - + - + - +
            nodeNode to set
            Node to set
            dataNew data pointer
            New data pointer
            destroyNew destructor function
            New destructor function

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not a custom node. +

            The node is not changed if it (or its first child) is not a custom node.

            mxmlSetCustomHandlers

            -

            Set the handling functions for custom data.

            +

            Set the handling functions for custom data.

            void mxmlSetCustomHandlers(mxml_custom_load_cb_t load, mxml_custom_save_cb_t save);

            Parameters

            - + - +
            loadLoad function
            Load function
            saveSave function
            Save function

            Discussion

            -

            The load function accepts a node pointer and a data string and must +

            The load function accepts a node pointer and a data string and must return 0 on success and non-zero on error.

            The save function accepts a node pointer and must return a malloc'd string on success and NULL on error.

            mxmlSetElement

            -

            Set the name of an element node.

            +

            Set the name of an element node.

            int mxmlSetElement(mxml_node_t *node, const char *name);

            Parameters

            - + - +
            nodeNode to set
            Node to set
            nameNew name string
            New name string

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it is not an element node.

            +

            The node is not changed if it is not an element node.

            mxmlSetErrorCallback

            -

            Set the error message callback.

            +

            Set the error message callback.

            void mxmlSetErrorCallback(mxml_error_cb_t cb);

            Parameters

            - +
            cbError callback function
            Error callback function

            mxmlSetInteger

            -

            Set the value of an integer node.

            +

            Set the value of an integer node.

            int mxmlSetInteger(mxml_node_t *node, int integer);

            Parameters

            - + - +
            nodeNode to set
            Node to set
            integerInteger value
            Integer value

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not an integer node.

            +

            The node is not changed if it (or its first child) is not an integer node.

            mxmlSetOpaque

            -

            Set the value of an opaque node.

            +

            Set the value of an opaque node.

            int mxmlSetOpaque(mxml_node_t *node, const char *opaque);

            Parameters

            - + - +
            nodeNode to set
            Node to set
            opaqueOpaque string
            Opaque string

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not an opaque node.

            +

            The node is not changed if it (or its first child) is not an opaque node.

             Mini-XML 2.11 mxmlSetOpaquef

            -

            Set the value of an opaque string node to a formatted string.

            +

            Set the value of an opaque string node to a formatted string.

            int mxmlSetOpaquef(mxml_node_t *node, const char *format, ...);

            Parameters

            - + - + - +
            nodeNode to set
            Node to set
            formatPrintf-style format string
            Printf-style format string
            ...Additional arguments as needed
            Additional arguments as needed

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not an opaque node. +

            The node is not changed if it (or its first child) is not an opaque node.

            mxmlSetReal

            -

            Set the value of a real number node.

            +

            Set the value of a real number node.

            int mxmlSetReal(mxml_node_t *node, double real);

            Parameters

            - + - +
            nodeNode to set
            Node to set
            realReal number value
            Real number value

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not a real number node.

            +

            The node is not changed if it (or its first child) is not a real number node.

            mxmlSetText

            -

            Set the value of a text node.

            +

            Set the value of a text node.

            int mxmlSetText(mxml_node_t *node, int whitespace, const char *string);

            Parameters

            - + - + - +
            nodeNode to set
            Node to set
            whitespace1 = leading whitespace, 0 = no whitespace
            1 = leading whitespace, 0 = no whitespace
            stringString
            String

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not a text node.

            +

            The node is not changed if it (or its first child) is not a text node.

            mxmlSetTextf

            -

            Set the value of a text node to a formatted string.

            +

            Set the value of a text node to a formatted string.

            int mxmlSetTextf(mxml_node_t *node, int whitespace, const char *format, ...);

            Parameters

            - + - + - + - +
            nodeNode to set
            Node to set
            whitespace1 = leading whitespace, 0 = no whitespace
            1 = leading whitespace, 0 = no whitespace
            formatPrintf-style format string
            Printf-style format string
            ...Additional arguments as needed
            Additional arguments as needed

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

            Discussion

            -

            The node is not changed if it (or its first child) is not a text node.

            +

            The node is not changed if it (or its first child) is not a text node.

             Mini-XML 2.7 mxmlSetUserData

            -

            Set the user data pointer for a node.

            +

            Set the user data pointer for a node.

            int mxmlSetUserData(mxml_node_t *node, void *data);

            Parameters

            - + - +
            nodeNode to set
            Node to set
            dataUser data pointer
            User data pointer

            Return Value

            -

            0 on success, -1 on failure

            +

            0 on success, -1 on failure

             Mini-XML 2.3 mxmlSetWrapMargin

            -

            Set the wrap margin when saving XML data.

            +

            Set the wrap margin when saving XML data.

            void mxmlSetWrapMargin(int column);

            Parameters

            - +
            columnColumn for wrapping, 0 to disable wrapping
            Column for wrapping, 0 to disable wrapping

            Discussion

            -

            Wrapping is disabled when "column" is 0. +

            Wrapping is disabled when "column" is 0.

            mxmlWalkNext

            -

            Walk to the next logical node in the tree.

            +

            Walk to the next logical node in the tree.

            mxml_node_t *mxmlWalkNext(mxml_node_t *node, mxml_node_t *top, int descend);

            Parameters

            - + - + - +
            nodeCurrent node
            Current node
            topTop node
            Top node
            descendDescend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST
            Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST

            Return Value

            -

            Next node or NULL

            +

            Next node or NULL

            Discussion

            -

            The descend argument controls whether the first child is considered +

            The descend argument controls whether the first child is considered to be the next node. The top node argument constrains the walk to the node's children.

            mxmlWalkPrev

            -

            Walk to the previous logical node in the tree.

            +

            Walk to the previous logical node in the tree.

            mxml_node_t *mxmlWalkPrev(mxml_node_t *node, mxml_node_t *top, int descend);

            Parameters

            - + - + - +
            nodeCurrent node
            Current node
            topTop node
            Top node
            descendDescend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST
            Descend into tree - MXML_DESCEND, MXML_NO_DESCEND, or MXML_DESCEND_FIRST

            Return Value

            -

            Previous node or NULL

            +

            Previous node or NULL

            Discussion

            -

            The descend argument controls whether the previous node's last child +

            The descend argument controls whether the previous node's last child is considered to be the previous node. The top node argument constrains the walk to the node's children.

            -

            Data Types

            -

            mxml_custom_destroy_cb_t

            -

            Custom data destructor

            -

            +

            Data Types

            +

            mxml_custom_destroy_cb_t

            +

            Custom data destructor

            +

            typedef void (*mxml_custom_destroy_cb_t)(void *);

            -

            mxml_custom_load_cb_t

            -

            Custom data load callback function

            -

            +

            mxml_custom_load_cb_t

            +

            Custom data load callback function

            +

            typedef int (*mxml_custom_load_cb_t)(mxml_node_t *, const char *);

            -

            mxml_custom_save_cb_t

            -

            Custom data save callback function

            -

            +

            mxml_custom_save_cb_t

            +

            Custom data save callback function

            +

            typedef char *(*mxml_custom_save_cb_t)(mxml_node_t *);

            -

            mxml_entity_cb_t

            -

            Entity callback function

            -

            +

            mxml_entity_cb_t

            +

            Entity callback function

            +

            typedef int (*mxml_entity_cb_t)(const char *);

            -

            mxml_error_cb_t

            -

            Error callback function

            -

            +

            mxml_error_cb_t

            +

            Error callback function

            +

            typedef void (*mxml_error_cb_t)(const char *);

            -

            mxml_index_t

            -

            An XML node index.

            -

            +

            mxml_index_t

            +

            An XML node index.

            +

            typedef struct _mxml_index_s mxml_index_t;

            -

            mxml_load_cb_t

            -

            Load callback function

            -

            +

            mxml_load_cb_t

            +

            Load callback function

            +

            typedef mxml_type_t (*mxml_load_cb_t)(mxml_node_t *);

            -

            mxml_node_t

            -

            An XML node.

            -

            +

            mxml_node_t

            +

            An XML node.

            +

            typedef struct _mxml_node_s mxml_node_t;

            -

            mxml_save_cb_t

            -

            Save callback function

            -

            +

            mxml_save_cb_t

            +

            Save callback function

            +

            typedef const char *(*mxml_save_cb_t)(mxml_node_t *, int);

            -

            mxml_sax_cb_t

            -

            SAX callback function

            -

            +

            mxml_sax_cb_t

            +

            SAX callback function

            +

            typedef void (*mxml_sax_cb_t)(mxml_node_t *, mxml_sax_event_t, void *);

            -

            mxml_sax_event_t

            -

            SAX event type.

            -

            +

            mxml_sax_event_t

            +

            SAX event type.

            +

            typedef enum mxml_sax_event_e mxml_sax_event_t;

            -

            mxml_type_t

            -

            The XML node type.

            -

            +

            mxml_type_t

            +

            The XML node type.

            +

            typedef enum mxml_type_e mxml_type_t;

            -

            Constants

            -

            mxml_sax_event_e

            -

            SAX event type.

            -

            Constants

            - - - - - - - -
            MXML_SAX_CDATA CDATA node
            MXML_SAX_COMMENT Comment node
            MXML_SAX_DATA Data node
            MXML_SAX_DIRECTIVE Processing directive node
            MXML_SAX_ELEMENT_CLOSE Element closed
            MXML_SAX_ELEMENT_OPEN Element opened
            -

            mxml_type_e

            -

            The XML node type.

            -

            Constants

            - - - - - - - - +

            Constants

            +

            mxml_sax_event_e

            +

            SAX event type.

            +

            Constants

            +
            MXML_CUSTOM  Mini-XML 2.1  Custom data
            MXML_ELEMENT XML element with attributes
            MXML_IGNORE  Mini-XML 2.3  Ignore/throw away node
            MXML_INTEGER Integer value
            MXML_OPAQUE Opaque string
            MXML_REAL Real value
            MXML_TEXT Text fragment
            + + + + + + +
            MXML_SAX_CDATA CDATA node
            MXML_SAX_COMMENT Comment node
            MXML_SAX_DATA Data node
            MXML_SAX_DIRECTIVE Processing directive node
            MXML_SAX_ELEMENT_CLOSE Element closed
            MXML_SAX_ELEMENT_OPEN Element opened
            +

            mxml_type_e

            +

            The XML node type.

            +

            Constants

            + + + + + + + +
            MXML_CUSTOM  Mini-XML 2.1 Custom data
            MXML_ELEMENT XML element with attributes
            MXML_IGNORE  Mini-XML 2.3 Ignore/throw away node
            MXML_INTEGER Integer value
            MXML_OPAQUE Opaque string
            MXML_REAL Real value
            MXML_TEXT Text fragment
            -
    - +
+ Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml.opacity and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml.opacity differ Binary files /tmp/tmpwulabnt6/6nsVEuzxOC/mxml-3.2/doc/mxml.png and /tmp/tmpwulabnt6/lirptRswkT/mxml-3.3/doc/mxml.png differ diff -Nru mxml-3.2/Makefile.in mxml-3.3/Makefile.in --- mxml-3.2/Makefile.in 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/Makefile.in 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ # # https://www.msweet.org/mxml # -# Copyright © 2003-2019 by Michael R Sweet. +# Copyright © 2003-2021 by Michael R Sweet. # # Licensed under Apache License v2.0. See the file "LICENSE" for more # information. @@ -17,20 +17,22 @@ ARFLAGS = @ARFLAGS@ ARCHFLAGS = @ARCHFLAGS@ CC = @CC@ -CFLAGS = $(OPTIM) $(ARCHFLAGS) @CFLAGS@ @CPPFLAGS@ @PTHREAD_FLAGS@ +CFLAGS = $(OPTIM) $(ARCHFLAGS) @CFLAGS@ $(CPPFLAGS) $(WARNINGS) CP = @CP@ +CPPFLAGS = @CPPFLAGS@ DSO = @DSO@ DSOFLAGS = @DSOFLAGS@ LDFLAGS = $(OPTIM) $(ARCHFLAGS) @LDFLAGS@ INSTALL = @INSTALL@ LIBMXML = @LIBMXML@ -LIBS = @LIBS@ @PTHREAD_LIBS@ +LIBS = @LIBS@ LN = @LN@ -s MKDIR = @MKDIR@ OPTIM = @OPTIM@ RANLIB = @RANLIB@ RM = @RM@ -f SHELL = /bin/sh +WARNINGS = @WARNINGS@ # @@ -52,10 +54,10 @@ # Install commands... # -INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m 755 +INSTALL_BIN = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 INSTALL_DIR = $(INSTALL) -d -INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m 755 +INSTALL_LIB = $(INSTALL) -m 755 INSTALL_MAN = $(INSTALL) -m 644 INSTALL_SCRIPT = $(INSTALL) -m 755 @@ -202,6 +204,34 @@ # +# Test everything... +# + +test: testmxml + @echo Testing library... + ./testmxml test.xml temp1s.xml >temp1.xml + ./testmxml temp1.xml temp2s.xml >temp2.xml + @if cmp temp1.xml temp2.xml; then \ + echo Stdio file test passed!; \ + $(RM) temp2.xml temp2s.xml; \ + else \ + echo Stdio file test failed!; \ + fi + @if cmp temp1.xml temp1s.xml; then \ + echo String test passed!; \ + $(RM) temp1.xml temp1s.xml; \ + else \ + echo String test failed!; \ + fi + @if cmp test.xml test.xmlfd; then \ + echo File descriptor test passed!; \ + $(RM) test.xmlfd temp1.xmlfd; \ + else \ + echo File descriptor test failed!; \ + fi + + +# # Figure out lines-of-code... # @@ -270,27 +300,6 @@ testmxml: libmxml.a testmxml.o echo Linking $@... $(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a $(LIBS) - @echo Testing library... - ./testmxml test.xml temp1s.xml >temp1.xml - ./testmxml temp1.xml temp2s.xml >temp2.xml - @if cmp temp1.xml temp2.xml; then \ - echo Stdio file test passed!; \ - $(RM) temp2.xml temp2s.xml; \ - else \ - echo Stdio file test failed!; \ - fi - @if cmp temp1.xml temp1s.xml; then \ - echo String test passed!; \ - $(RM) temp1.xml temp1s.xml; \ - else \ - echo String test failed!; \ - fi - @if cmp test.xml test.xmlfd; then \ - echo File descriptor test passed!; \ - $(RM) test.xmlfd temp1.xmlfd; \ - else \ - echo File descriptor test failed!; \ - fi testmxml-vg: $(LIBOBJS) testmxml.o echo Linking $@... @@ -300,6 +309,27 @@ # +# Analyze code with the Clang static analyzer +# + +.PHONY: clang +clang: + clang $(CPPFLAGS) --analyze $(OBJS:.o=.c) 2>clang.log + rm -rf $(OBJS:.o=.plist) + test -s clang.log && (echo "$(GHA_ERROR)Clang detected issues."; echo ""; cat clang.log; exit 1) || exit 0 + + +# +# Analyze code using Cppcheck +# + +.PHONY: cppcheck +cppcheck: + cppcheck $(CPPFLAGS) --template=gcc --addon=cert.py --suppressions-list=.cppcheck $(OBJS:.o=.c) 2>cppcheck.log + test -s cppcheck.log && (echo "$(GHA_ERROR)Cppcheck detected issues."; echo ""; cat cppcheck.log; exit 1) || exit 0 + + +# # Documentation (depends on separate codedoc utility) # diff -Nru mxml-3.2/mxml-attr.c mxml-3.3/mxml-attr.c --- mxml-3.2/mxml-attr.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-attr.c 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2019 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -217,7 +217,13 @@ return; if (value) - valuec = strdup(value); + { + if ((valuec = strdup(value)) == NULL) + { + mxml_error("Unable to allocate memory for attribute '%s' in element %s.", name, node->value.element.name); + return; + } + } else valuec = NULL; @@ -269,7 +275,7 @@ va_end(ap); if (!value) - mxml_error("Unable to allocate memory for attribute '%s' in element %s!", + mxml_error("Unable to allocate memory for attribute '%s' in element %s.", name, node->value.element.name); else if (mxml_set_attr(node, name, value)) free(value); @@ -302,9 +308,7 @@ * Free the old value as needed... */ - if (attr->value) - free(attr->value); - + free(attr->value); attr->value = value; return (0); @@ -322,7 +326,7 @@ if (!attr) { - mxml_error("Unable to allocate memory for attribute '%s' in element %s!", + mxml_error("Unable to allocate memory for attribute '%s' in element %s.", name, node->value.element.name); return (-1); } @@ -332,7 +336,7 @@ if ((attr->name = strdup(name)) == NULL) { - mxml_error("Unable to allocate memory for attribute '%s' in element %s!", + mxml_error("Unable to allocate memory for attribute '%s' in element %s.", name, node->value.element.name); return (-1); } diff -Nru mxml-3.2/mxml-file.c mxml-3.3/mxml-file.c --- mxml-3.2/mxml-file.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-file.c 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2020 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -187,13 +187,12 @@ * * This function returns a pointer to a string containing the textual * representation of the XML node tree. The string should be freed - * using the free() function when you are done with it. @code NULL@ is returned - * if the node would produce an empty string or if the string cannot be - * allocated. + * using `free()` when you are done with it. `NULL` is returned if the node + * would produce an empty string or if the string cannot be allocated. * * The callback argument specifies a function that returns a whitespace - * string or NULL before and after each element. If @code MXML_NO_CALLBACK@ - * is specified, whitespace will only be added before @code MXML_TEXT@ nodes + * string or `NULL` before and after each element. If `MXML_NO_CALLBACK` + * is specified, whitespace will only be added before `MXML_TEXT` nodes * with leading whitespace and before attribute names inside opening * element tags. */ @@ -376,7 +375,10 @@ */ if (ptr[0] >= ptr[1]) - buffer[bufsize - 1] = '\0'; + { + if (bufsize > 0) + buffer[bufsize - 1] = '\0'; + } else ptr[0][0] = '\0'; @@ -588,9 +590,7 @@ if ((newbuffer = realloc(*buffer, *bufsize)) == NULL) { - free(*buffer); - - mxml_error("Unable to expand string buffer to %d bytes!", *bufsize); + mxml_error("Unable to expand string buffer to %d bytes.", *bufsize); return (-1); } @@ -682,7 +682,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -746,7 +746,7 @@ if (ch < 0x80) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } } @@ -780,7 +780,7 @@ if (ch < 0x800) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } @@ -832,7 +832,7 @@ if (ch < 0x10000) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } } @@ -855,7 +855,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -903,7 +903,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -1096,7 +1096,7 @@ { if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -1148,7 +1148,7 @@ if (ch < 0x80) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } } @@ -1170,7 +1170,7 @@ if (ch < 0x800) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } @@ -1204,7 +1204,7 @@ if (ch < 0x10000) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } } @@ -1221,7 +1221,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -1250,7 +1250,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -1368,9 +1368,9 @@ mxml_sax_cb_t sax_cb, /* I - SAX callback or MXML_NO_CALLBACK */ void *sax_data) /* I - SAX user data */ { - mxml_node_t *node, /* Current node */ - *first, /* First node added */ - *parent; /* Current parent node */ + mxml_node_t *node = NULL, /* Current node */ + *first = NULL, /* First node added */ + *parent = NULL; /* Current parent node */ int line = 1, /* Current line number */ ch, /* Character from file */ whitespace; /* Non-zero if whitespace seen */ @@ -1398,7 +1398,7 @@ if ((buffer = malloc(64)) == NULL) { - mxml_error("Unable to allocate string buffer!"); + mxml_error("Unable to allocate string buffer."); return (NULL); } @@ -1561,7 +1561,7 @@ break; else if (ch == '<') { - mxml_error("Bare < in element!"); + mxml_error("Bare < in element."); goto error; } else if (ch == '&') @@ -1935,8 +1935,13 @@ { (*sax_cb)(node, MXML_SAX_ELEMENT_CLOSE, sax_data); - if (!mxmlRelease(node) && first == node) - first = NULL; + if (!mxmlRelease(node)) + { + if (first == node) + first = NULL; + + node = NULL; + } } /* @@ -1983,6 +1988,7 @@ { mxml_error("Expected > but got '%c' instead for element <%s/> on line %d.", ch, buffer, line); mxmlDelete(node); + node = NULL; goto error; } @@ -2015,8 +2021,13 @@ { (*sax_cb)(node, MXML_SAX_ELEMENT_CLOSE, sax_data); - if (!mxmlRelease(node) && first == node) - first = NULL; + if (!mxmlRelease(node)) + { + if (first == node) + first = NULL; + + node = NULL; + } } } @@ -2119,7 +2130,7 @@ if ((name = malloc(64)) == NULL) { - mxml_error("Unable to allocate memory for name!"); + mxml_error("Unable to allocate memory for name."); return (EOF); } @@ -2128,7 +2139,7 @@ if ((value = malloc(64)) == NULL) { free(name); - mxml_error("Unable to allocate memory for value!"); + mxml_error("Unable to allocate memory for value."); return (EOF); } @@ -2438,7 +2449,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -2488,7 +2499,7 @@ if (ch < 0x80) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } @@ -2514,7 +2525,7 @@ if (ch < 0x800) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } @@ -2549,7 +2560,7 @@ if (ch < 0x10000) { - mxml_error("Invalid UTF-8 sequence for character 0x%04x!", ch); + mxml_error("Invalid UTF-8 sequence for character 0x%04x.", ch); return (EOF); } @@ -2572,7 +2583,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } @@ -2620,7 +2631,7 @@ if (mxml_bad_char(ch)) { - mxml_error("Bad control character 0x%02x not allowed by XML standard!", + mxml_error("Bad control character 0x%02x not allowed by XML standard.", ch); return (EOF); } diff -Nru mxml-3.2/mxml.h mxml-3.3/mxml.h --- mxml-3.2/mxml.h 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml.h 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2019 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -32,7 +32,7 @@ */ # define MXML_MAJOR_VERSION 3 /* Major version number */ -# define MXML_MINOR_VERSION 1 /* Minor version number */ +# define MXML_MINOR_VERSION 2 /* Minor version number */ # define MXML_TAB 8 /* Tabs every N columns */ diff -Nru mxml-3.2/mxml-index.c mxml-3.3/mxml-index.c --- mxml-3.2/mxml-index.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-index.c 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2019 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -46,12 +46,8 @@ * Free memory... */ - if (ind->attr) - free(ind->attr); - - if (ind->alloc_nodes) - free(ind->nodes); - + free(ind->attr); + free(ind->nodes); free(ind); } @@ -330,12 +326,19 @@ if ((ind = calloc(1, sizeof(mxml_index_t))) == NULL) { - mxml_error("Unable to allocate %d bytes for index - %s", (int)sizeof(mxml_index_t), strerror(errno)); + mxml_error("Unable to allocate memory for index."); return (NULL); } if (attr) - ind->attr = strdup(attr); + { + if ((ind->attr = strdup(attr)) == NULL) + { + mxml_error("Unable to allocate memory for index attribute."); + free(ind); + return (NULL); + } + } if (!element && !attr) current = node; @@ -357,8 +360,7 @@ * Unable to allocate memory for the index, so abort... */ - mxml_error("Unable to allocate %d bytes for index: %s", (int)((ind->alloc_nodes + 64) * sizeof(mxml_node_t *)), strerror(errno)); - + mxml_error("Unable to allocate memory for index nodes."); mxmlIndexDelete(ind); return (NULL); } diff -Nru mxml-3.2/mxml-node.c mxml-3.3/mxml-node.c --- mxml-3.2/mxml-node.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-node.c 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2019 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -772,17 +772,14 @@ switch (node->type) { case MXML_ELEMENT : - if (node->value.element.name) - free(node->value.element.name); + free(node->value.element.name); if (node->value.element.num_attrs) { for (i = 0; i < node->value.element.num_attrs; i ++) { - if (node->value.element.attrs[i].name) - free(node->value.element.attrs[i].name); - if (node->value.element.attrs[i].value) - free(node->value.element.attrs[i].value); + free(node->value.element.attrs[i].name); + free(node->value.element.attrs[i].value); } free(node->value.element.attrs); @@ -792,15 +789,13 @@ /* Nothing to do */ break; case MXML_OPAQUE : - if (node->value.opaque) - free(node->value.opaque); + free(node->value.opaque); break; case MXML_REAL : /* Nothing to do */ break; case MXML_TEXT : - if (node->value.text.string) - free(node->value.text.string); + free(node->value.text.string); break; case MXML_CUSTOM : if (node->value.custom.data && diff -Nru mxml-3.2/mxml.pc.in mxml-3.3/mxml.pc.in --- mxml-3.2/mxml.pc.in 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml.pc.in 2021-11-09 13:48:36.000000000 +0000 @@ -6,5 +6,5 @@ Name: Mini-XML Description: Lightweight XML support library Version: @VERSION@ -Libs: @PC_LIBS@ @PTHREAD_LIBS@ -Cflags: @PC_CFLAGS@ @PTHREAD_FLAGS@ +Libs: @PC_LIBS@ +Cflags: @PC_CFLAGS@ diff -Nru mxml-3.2/mxml-private.c mxml-3.3/mxml-private.c --- mxml-3.2/mxml-private.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-private.c 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2019 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -140,7 +140,7 @@ #ifdef HAVE_PTHREAD_H /**** POSIX threading ****/ # include -static pthread_key_t _mxml_key = -1; /* Thread local storage key */ +static pthread_key_t _mxml_key; /* Thread local storage key */ static pthread_once_t _mxml_key_once = PTHREAD_ONCE_INIT; /* One-time initialization object */ static void _mxml_init(void); @@ -168,14 +168,10 @@ _mxml_global_t *global; /* Global data */ - if (_mxml_key != -1) - { - if ((global = (_mxml_global_t *)pthread_getspecific(_mxml_key)) != NULL) - _mxml_destructor(global); - - pthread_key_delete(_mxml_key); - _mxml_key = -1; - } + if ((global = (_mxml_global_t *)pthread_getspecific(_mxml_key)) != NULL) + _mxml_destructor(global); + + pthread_key_delete(_mxml_key); } diff -Nru mxml-3.2/mxml-set.c mxml-3.3/mxml-set.c --- mxml-3.2/mxml-set.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-set.c 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2019 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -29,7 +29,7 @@ mxmlSetCDATA(mxml_node_t *node, /* I - Node to set */ const char *data) /* I - New data string */ { - char *s; /* String pointer */ + char *s; /* New element name */ /* @@ -42,22 +42,38 @@ !strncmp(node->child->value.element.name, "![CDATA[", 8)) node = node->child; - if (!node || node->type != MXML_ELEMENT || !data || + if (!node || node->type != MXML_ELEMENT || strncmp(node->value.element.name, "![CDATA[", 8)) + { + mxml_error("Wrong node type."); return (-1); + } + else if (!data) + { + mxml_error("NULL string not allowed."); + return (-1); + } if (data == (node->value.element.name + 8)) + { + /* + * Don't change the value... + */ + return (0); + } /* * Allocate the new value, free any old element value, and set the new value... */ - s = _mxml_strdupf("![CDATA[%s", data); - - if (node->value.element.name) - free(node->value.element.name); + if ((s = _mxml_strdupf("![CDATA[%s", data)) == NULL) + { + mxml_error("Unable to allocate memory for CDATA."); + return (-1); + } + free(node->value.element.name); node->value.element.name = s; return (0); @@ -87,7 +103,10 @@ node = node->child; if (!node || node->type != MXML_CUSTOM) + { + mxml_error("Wrong node type."); return (-1); + } if (data == node->value.custom.data) { @@ -119,12 +138,23 @@ mxmlSetElement(mxml_node_t *node, /* I - Node to set */ const char *name) /* I - New name string */ { + char *s; /* New name string */ + + /* * Range check input... */ - if (!node || node->type != MXML_ELEMENT || !name) + if (!node || node->type != MXML_ELEMENT) + { + mxml_error("Wrong node type."); return (-1); + } + else if (!name) + { + mxml_error("NULL string not allowed."); + return (-1); + } if (name == node->value.element.name) return (0); @@ -133,10 +163,14 @@ * Free any old element value and set the new value... */ - if (node->value.element.name) - free(node->value.element.name); + if ((s = strdup(name)) == NULL) + { + mxml_error("Unable to allocate memory for element name."); + return (-1); + } - node->value.element.name = strdup(name); + free(node->value.element.name); + node->value.element.name = s; return (0); } @@ -161,7 +195,10 @@ node = node->child; if (!node || node->type != MXML_INTEGER) + { + mxml_error("Wrong node type."); return (-1); + } /* * Set the new value and return... @@ -183,6 +220,9 @@ mxmlSetOpaque(mxml_node_t *node, /* I - Node to set */ const char *opaque) /* I - Opaque string */ { + char *s; /* New opaque string */ + + /* * Range check input... */ @@ -191,8 +231,16 @@ node->child && node->child->type == MXML_OPAQUE) node = node->child; - if (!node || node->type != MXML_OPAQUE || !opaque) + if (!node || node->type != MXML_OPAQUE) + { + mxml_error("Wrong node type."); + return (-1); + } + else if (!opaque) + { + mxml_error("NULL string not allowed."); return (-1); + } if (node->value.opaque == opaque) return (0); @@ -201,10 +249,14 @@ * Free any old opaque value and set the new value... */ - if (node->value.opaque) - free(node->value.opaque); + if ((s = strdup(opaque)) == NULL) + { + mxml_error("Unable to allocate memory for opaque string."); + return (-1); + } - node->value.opaque = strdup(opaque); + free(node->value.opaque); + node->value.opaque = s; return (0); } @@ -235,8 +287,16 @@ node->child && node->child->type == MXML_OPAQUE) node = node->child; - if (!node || node->type != MXML_OPAQUE || !format) + if (!node || node->type != MXML_OPAQUE) + { + mxml_error("Wrong node type."); return (-1); + } + else if (!format) + { + mxml_error("NULL string not allowed."); + return (-1); + } /* * Format the new string, free any old string value, and set the new value... @@ -246,9 +306,13 @@ s = _mxml_vstrdupf(format, ap); va_end(ap); - if (node->value.opaque) - free(node->value.opaque); + if (!s) + { + mxml_error("Unable to allocate memory for opaque string."); + return (-1); + } + free(node->value.opaque); node->value.opaque = s; return (0); @@ -274,7 +338,10 @@ node = node->child; if (!node || node->type != MXML_REAL) + { + mxml_error("Wrong node type."); return (-1); + } /* * Set the new value and return... @@ -297,6 +364,9 @@ int whitespace, /* I - 1 = leading whitespace, 0 = no whitespace */ const char *string) /* I - String */ { + char *s; /* New string */ + + /* * Range check input... */ @@ -305,8 +375,16 @@ node->child && node->child->type == MXML_TEXT) node = node->child; - if (!node || node->type != MXML_TEXT || !string) + if (!node || node->type != MXML_TEXT) + { + mxml_error("Wrong node type."); + return (-1); + } + else if (!string) + { + mxml_error("NULL string not allowed."); return (-1); + } if (string == node->value.text.string) { @@ -318,11 +396,16 @@ * Free any old string value and set the new value... */ - if (node->value.text.string) - free(node->value.text.string); + if ((s = strdup(string)) == NULL) + { + mxml_error("Unable to allocate memory for text string."); + return (-1); + } + + free(node->value.text.string); node->value.text.whitespace = whitespace; - node->value.text.string = strdup(string); + node->value.text.string = s; return (0); } @@ -352,8 +435,16 @@ node->child && node->child->type == MXML_TEXT) node = node->child; - if (!node || node->type != MXML_TEXT || !format) + if (!node || node->type != MXML_TEXT) + { + mxml_error("Wrong node type."); return (-1); + } + else if (!format) + { + mxml_error("NULL string not allowed."); + return (-1); + } /* * Free any old string value and set the new value... @@ -363,8 +454,13 @@ s = _mxml_vstrdupf(format, ap); va_end(ap); - if (node->value.text.string) - free(node->value.text.string); + if (!s) + { + mxml_error("Unable to allocate memory for text string."); + return (-1); + } + + free(node->value.text.string); node->value.text.whitespace = whitespace; node->value.text.string = s; diff -Nru mxml-3.2/mxml-string.c mxml-3.3/mxml-string.c --- mxml-3.2/mxml-string.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/mxml-string.c 2021-11-09 13:48:36.000000000 +0000 @@ -114,7 +114,7 @@ size_t /* O - Number of bytes copied */ _mxml_strlcat(char *dst, /* I - Destination buffer */ const char *src, /* I - Source string */ - size_t dstsize) /* I - Size of destinatipon buffer */ + size_t dstsize) /* I - Size of destination buffer */ { size_t srclen; /* Length of source string */ size_t dstlen; /* Length of destination string */ @@ -160,7 +160,7 @@ size_t /* O - Number of bytes copied */ _mxml_strlcpy(char *dst, /* I - Destination buffer */ const char *src, /* I - Source string */ - size_t dstsize) /* I - Size of destinatipon buffer */ + size_t dstsize) /* I - Size of destination buffer */ { size_t srclen; /* Length of source string */ @@ -374,11 +374,11 @@ if ((width + 2) > sizeof(temp)) break; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT if (size == 'L') sprintf(temp, tformat, va_arg(ap, long long)); else -#endif /* HAVE_LONG_LONG */ +#endif /* HAVE_LONG_LONG_INT */ sprintf(temp, tformat, va_arg(ap, int)); bytes += strlen(temp); @@ -517,8 +517,10 @@ #else int bytes; /* Number of bytes required */ - char *buffer, /* String buffer */ - temp[256]; /* Small buffer for first vsnprintf */ + char *buffer; /* String buffer */ +# ifndef _WIN32 + char temp[256]; /* Small buffer for first vsnprintf */ +# endif /* !_WIN32 */ /* diff -Nru mxml-3.2/README.md mxml-3.3/README.md --- mxml-3.2/README.md 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/README.md 2021-11-09 13:48:36.000000000 +0000 @@ -1,5 +1,12 @@ -Mini-XML Version 3.2 -==================== +Mini-XML - Tiny XML Parsing Library +=================================== + +![Version](https://img.shields.io/github/v/release/michaelrsweet/mxml?include_prereleases) +![Apache 2.0](https://img.shields.io/github/license/michaelrsweet/mxml) +![Build](https://github.com/michaelrsweet/mxml/workflows/Build/badge.svg) +[![Coverity Scan Status](https://img.shields.io/coverity/scan/23959.svg)](https://scan.coverity.com/projects/michaelrsweet-mxml) +[![LGTM Grade](https://img.shields.io/lgtm/grade/cpp/github/michaelrsweet/mxml)](https://lgtm.com/projects/g/michaelrsweet/mxml/context:cpp) +[![LGTM Alerts](https://img.shields.io/lgtm/alerts/github/michaelrsweet/mxml)](https://lgtm.com/projects/g/michaelrsweet/mxml/) Mini-XML is a small XML parsing library that you can use to read XML data files or strings in your application without requiring large non-standard libraries. @@ -192,7 +199,7 @@ Legal Stuff ----------- -Copyright © 2003-2020 by Michael R Sweet +Copyright © 2003-2021 by Michael R Sweet The Mini-XML library is licensed under the Apache License Version 2.0 with an *optional* exception to allow linking against GPL2/LGPL2-only software. See the diff -Nru mxml-3.2/testmxml.c mxml-3.3/testmxml.c --- mxml-3.2/testmxml.c 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/testmxml.c 2021-11-09 13:48:36.000000000 +0000 @@ -661,7 +661,7 @@ memset(event_counts, 0, sizeof(event_counts)); if (argv[1][0] == '<') - mxmlSAXLoadString(NULL, argv[1], type_cb, sax_cb, NULL); + mxmlRelease(mxmlSAXLoadString(NULL, argv[1], type_cb, sax_cb, NULL)); else if ((fp = fopen(argv[1], "rb")) == NULL) { perror(argv[1]); @@ -673,7 +673,7 @@ * Read the file... */ - mxmlSAXLoadFile(NULL, fp, type_cb, sax_cb, NULL); + mxmlRelease(mxmlSAXLoadFile(NULL, fp, type_cb, sax_cb, NULL)); fclose(fp); } diff -Nru mxml-3.2/vcnet/config.h mxml-3.3/vcnet/config.h --- mxml-3.2/vcnet/config.h 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/vcnet/config.h 2021-11-09 13:48:36.000000000 +0000 @@ -2,7 +2,7 @@ * Visual Studio configuration file for Mini-XML, a small XML file parsing * library. * - * Copyright 2003-2020 by Michael R Sweet. + * Copyright 2003-2021 by Michael R Sweet. * * These coded instructions, statements, and computer programs are the * property of Michael R Sweet and are protected by Federal copyright @@ -63,7 +63,7 @@ * Version number... */ -#define MXML_VERSION "Mini-XML v3.2" +#define MXML_VERSION "Mini-XML v3.3" /* @@ -77,7 +77,7 @@ * Long long support... */ -#define HAVE_LONG_LONG 1 +#define HAVE_LONG_LONG_INT 1 /* diff -Nru mxml-3.2/vcnet/libmxml1_native.nuspec mxml-3.3/vcnet/libmxml1_native.nuspec --- mxml-3.2/vcnet/libmxml1_native.nuspec 1970-01-01 00:00:00.000000000 +0000 +++ mxml-3.3/vcnet/libmxml1_native.nuspec 2021-11-09 13:48:36.000000000 +0000 @@ -0,0 +1,30 @@ + + + + libmxml1_native + Small XML File Parsing Library for VS2019+ + 3.3.0 + Michael R Sweet + michaelrsweet + https://github.com/michaelrsweet/mxml + Apache-2.0 + build/native/mxml-128.png + build/native/README.md + false + Small XML File Parsing Library + Mini-XML is a small XML parsing library that you can use to read XML data files or strings in your application without requiring large non-standard libraries. + Copyright © 2003-2021 by Michael R Sweet + xml + + + + + + + + + + + + + diff -Nru mxml-3.2/vcnet/libmxml1_native.props mxml-3.3/vcnet/libmxml1_native.props --- mxml-3.2/vcnet/libmxml1_native.props 1970-01-01 00:00:00.000000000 +0000 +++ mxml-3.3/vcnet/libmxml1_native.props 2021-11-09 13:48:36.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + $(MSBuildThisFileDirectory)\include + + + $(MSBuildThisFileDirectory)\lib\$(Platform)\$(Configuration)\libmxml1.lib;%(AdditionalDependencies) + + + diff -Nru mxml-3.2/vcnet/libmxml1_native.redist.nuspec mxml-3.3/vcnet/libmxml1_native.redist.nuspec --- mxml-3.2/vcnet/libmxml1_native.redist.nuspec 1970-01-01 00:00:00.000000000 +0000 +++ mxml-3.3/vcnet/libmxml1_native.redist.nuspec 2021-11-09 13:48:36.000000000 +0000 @@ -0,0 +1,25 @@ + + + + libmxml1_native.redist + Small XML File Parsing Library for VS2019+ Redist + 3.3.0 + Michael R Sweet + michaelrsweet + https://github.com/michaelrsweet/mxml + Apache-2.0 + build/native/mxml-128.png + build/native/README.md + false + Redistributable components for package 'libmxml1_native'. This package should only be installed as a dependency. + Mini-XML is a small XML parsing library that you can use to read XML data files or strings in your application without requiring large non-standard libraries. This package provides the redistributable content for Mini-XML. + Copyright © 2003-2021 by Michael R Sweet + xml + + + + + + + + diff -Nru mxml-3.2/vcnet/mxml1.vcxproj mxml-3.3/vcnet/mxml1.vcxproj --- mxml-3.2/vcnet/mxml1.vcxproj 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/vcnet/mxml1.vcxproj 2021-11-09 13:48:36.000000000 +0000 @@ -21,27 +21,27 @@ {E5AA9476-9751-4654-8109-B1A2112D5E73} Win32Proj - 8.1 + 10.0 DynamicLibrary - v141 + v142 MultiByte DynamicLibrary - v141 + v142 MultiByte DynamicLibrary - v141 + v142 MultiByte DynamicLibrary - v141 + v142 MultiByte @@ -68,23 +68,23 @@ <_ProjectFileVersion>15.0.27924.0 - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ true - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ false - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ true - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ false @@ -100,7 +100,7 @@ EditAndContinue - $(Configuration)\$(Platform)\$(ProductName)\mxml1.dll + $(Platform)\$(Configuration)\$(ProductName)\mxml1.dll oldnames.lib;%(IgnoreSpecificDefaultLibraries) .\mxml1.def true @@ -122,7 +122,7 @@ ProgramDatabase - $(Configuration)\$(Platform)\$(ProductName)\mxml1.dll + $(Platform)\$(Configuration)\$(ProductName)\mxml1.dll oldnames.lib;%(IgnoreSpecificDefaultLibraries) .\mxml1.def false @@ -151,7 +151,7 @@ ProgramDatabase - $(Configuration)\$(Platform)\$(ProductName)\mxml1.dll + $(Platform)\$(Configuration)\$(ProductName)\mxml1.dll oldnames.lib;%(IgnoreSpecificDefaultLibraries) .\mxml1.def true @@ -176,7 +176,7 @@ ProgramDatabase - $(Configuration)\$(Platform)\$(ProductName)\mxml1.dll + $(Platform)\$(Configuration)\$(ProductName)\mxml1.dll oldnames.lib;%(IgnoreSpecificDefaultLibraries) .\mxml1.def false diff -Nru mxml-3.2/vcnet/mxml.sln mxml-3.3/vcnet/mxml.sln --- mxml-3.2/vcnet/mxml.sln 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/vcnet/mxml.sln 2021-11-09 13:48:36.000000000 +0000 @@ -1,14 +1,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2036 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30204.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mxml1", "mxml1.vcxproj", "{E5AA9476-9751-4654-8109-B1A2112D5E73}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mxmldoc", "mxmldoc.vcxproj", "{D909892E-520A-4322-9A47-DAEBDA9CC7A7}" - ProjectSection(ProjectDependencies) = postProject - {E5AA9476-9751-4654-8109-B1A2112D5E73} = {E5AA9476-9751-4654-8109-B1A2112D5E73} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testmxml", "testmxml.vcxproj", "{75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}" ProjectSection(ProjectDependencies) = postProject {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958} = {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958} @@ -18,44 +13,22 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E5AA9476-9751-4654-8109-B1A2112D5E73}.Debug|Win32.ActiveCfg = Debug|Win32 - {E5AA9476-9751-4654-8109-B1A2112D5E73}.Debug|Win32.Build.0 = Debug|Win32 {E5AA9476-9751-4654-8109-B1A2112D5E73}.Debug|x64.ActiveCfg = Debug|Win32 {E5AA9476-9751-4654-8109-B1A2112D5E73}.Debug|x64.Build.0 = Debug|Win32 - {E5AA9476-9751-4654-8109-B1A2112D5E73}.Release|Win32.ActiveCfg = Debug|Win32 - {E5AA9476-9751-4654-8109-B1A2112D5E73}.Release|Win32.Build.0 = Debug|Win32 - {E5AA9476-9751-4654-8109-B1A2112D5E73}.Release|x64.ActiveCfg = Debug|Win32 - {E5AA9476-9751-4654-8109-B1A2112D5E73}.Release|x64.Build.0 = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Debug|Win32.ActiveCfg = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Debug|Win32.Build.0 = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Debug|x64.ActiveCfg = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Debug|x64.Build.0 = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Release|Win32.ActiveCfg = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Release|Win32.Build.0 = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Release|x64.ActiveCfg = Debug|Win32 - {D909892E-520A-4322-9A47-DAEBDA9CC7A7}.Release|x64.Build.0 = Debug|Win32 - {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Debug|Win32.ActiveCfg = Debug|Win32 - {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Debug|Win32.Build.0 = Debug|Win32 + {E5AA9476-9751-4654-8109-B1A2112D5E73}.Release|x64.ActiveCfg = Debug|x64 + {E5AA9476-9751-4654-8109-B1A2112D5E73}.Release|x64.Build.0 = Debug|x64 {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Debug|x64.ActiveCfg = Debug|Win32 {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Debug|x64.Build.0 = Debug|Win32 - {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Release|Win32.ActiveCfg = Debug|Win32 - {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Release|Win32.Build.0 = Debug|Win32 - {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Release|x64.ActiveCfg = Debug|Win32 - {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Release|x64.Build.0 = Debug|Win32 - {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Debug|Win32.Build.0 = Debug|Win32 + {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Release|x64.ActiveCfg = Debug|x64 + {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227}.Release|x64.Build.0 = Debug|x64 {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Debug|x64.ActiveCfg = Debug|Win32 {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Debug|x64.Build.0 = Debug|Win32 - {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Release|Win32.ActiveCfg = Debug|Win32 - {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Release|Win32.Build.0 = Debug|Win32 - {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Release|x64.ActiveCfg = Debug|Win32 - {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Release|x64.Build.0 = Debug|Win32 + {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Release|x64.ActiveCfg = Debug|x64 + {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958}.Release|x64.Build.0 = Debug|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff -Nru mxml-3.2/vcnet/mxmlstat.vcxproj mxml-3.3/vcnet/mxmlstat.vcxproj --- mxml-3.2/vcnet/mxmlstat.vcxproj 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/vcnet/mxmlstat.vcxproj 2021-11-09 13:48:36.000000000 +0000 @@ -39,32 +39,32 @@ {CDEEBB3C-D45B-4CC5-BE9B-0BD415A27958} Win32Proj mxmlstat - 8.1 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode @@ -88,23 +88,23 @@ true - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ true - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ false - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ false - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ diff -Nru mxml-3.2/vcnet/testmxml.vcxproj mxml-3.3/vcnet/testmxml.vcxproj --- mxml-3.2/vcnet/testmxml.vcxproj 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/vcnet/testmxml.vcxproj 2021-11-09 13:48:36.000000000 +0000 @@ -21,27 +21,27 @@ {75CAC6C4-A6BC-4935-A3C9-8F0AE0744227} Win32Proj - 8.1 + 10.0 Application - v141 + v142 MultiByte Application - v141 + v142 MultiByte Application - v141 + v142 MultiByte Application - v141 + v142 MultiByte @@ -68,23 +68,23 @@ <_ProjectFileVersion>15.0.27924.0 - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ true - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ false - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ true - $(Configuration)\$(Platform)\$(ProjectName)\ - $(Configuration)\$(Platform)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ false @@ -100,7 +100,7 @@ EditAndContinue - $(Configuration)\$(Platform)\$(ProductName)\testmxml.exe + $(Platform)\$(Configuration)\$(ProductName)\testmxml.exe oldnames.lib;%(IgnoreSpecificDefaultLibraries) true $(OutDir)testmxml.pdb @@ -121,7 +121,7 @@ ProgramDatabase - $(Configuration)\$(Platform)\$(ProductName)\testmxml.exe + $(Platform)\$(Configuration)\$(ProductName)\testmxml.exe oldnames.lib;%(IgnoreSpecificDefaultLibraries) true Console @@ -149,7 +149,7 @@ ProgramDatabase - $(Configuration)\$(Platform)\$(ProductName)\testmxml.exe + $(Platform)\$(Configuration)\$(ProductName)\testmxml.exe oldnames.lib;%(IgnoreSpecificDefaultLibraries) true $(OutDir)testmxml.pdb @@ -173,7 +173,7 @@ ProgramDatabase - $(Configuration)\$(Platform)\$(ProductName)\testmxml.exe + $(Platform)\$(Configuration)\$(ProductName)\testmxml.exe oldnames.lib;%(IgnoreSpecificDefaultLibraries) true Console diff -Nru mxml-3.2/xcode/config.h mxml-3.3/xcode/config.h --- mxml-3.2/xcode/config.h 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/xcode/config.h 2021-11-09 13:48:36.000000000 +0000 @@ -3,7 +3,7 @@ * * https://www.msweet.org/mxml * - * Copyright © 2003-2020 by Michael R Sweet. + * Copyright © 2003-2021 by Michael R Sweet. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. @@ -24,7 +24,7 @@ * Version number... */ -#define MXML_VERSION "Mini-XML v3.2" +#define MXML_VERSION "Mini-XML v3.3" /* @@ -38,7 +38,7 @@ * Long long support... */ -#define HAVE_LONG_LONG 1 +#define HAVE_LONG_LONG_INT 1 /* diff -Nru mxml-3.2/xcode/mxml.xcodeproj/project.pbxproj mxml-3.3/xcode/mxml.xcodeproj/project.pbxproj --- mxml-3.2/xcode/mxml.xcodeproj/project.pbxproj 2020-10-13 13:21:26.000000000 +0000 +++ mxml-3.3/xcode/mxml.xcodeproj/project.pbxproj 2021-11-09 13:48:36.000000000 +0000 @@ -228,7 +228,7 @@ 272CFFFD1E8C6664007EBCAC /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1310; ORGANIZATIONNAME = "Michael R Sweet"; TargetAttributes = { 272C00041E8C6664007EBCAC = { @@ -344,6 +344,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -370,7 +371,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_PARAMETER = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = YES; @@ -407,6 +408,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -427,7 +429,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_PARAMETER = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; @@ -455,6 +457,7 @@ 272C003E1E8C6AEB007EBCAC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "-"; DEVELOPMENT_TEAM = RU58A2256H; MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -464,6 +467,7 @@ 272C003F1E8C6AEB007EBCAC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "-"; DEVELOPMENT_TEAM = RU58A2256H; MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_NAME = "$(TARGET_NAME)";