diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 581dee234..2e48ae7bd 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -31,7 +31,7 @@ jobs: run: sudo apt-get install flex bison make libboost-all-dev libgsl-dev python3 python3-pip - name: Checkout truth - run: git clone --branch master https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite + run: git clone --branch more_checkpointing_truth_files https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite - uses: actions/checkout@v3 - name: configure @@ -79,7 +79,7 @@ jobs: - name: add random Haskell lib run: cabal install --lib random - name: Checkout truth - run: git clone --branch master https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite + run: git clone --branch more_checkpointing_truth_files https://github.com/jlab/gapc-test-suite.git $GITHUB_WORKSPACE/../gapc-test-suite - uses: actions/checkout@v3 - name: configure diff --git a/aclocal.m4 b/aclocal.m4 index 3c383e76e..6da9de3e5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -176,7 +176,9 @@ int main (void) AU_ALIAS([AM_PATH_GSL], [AX_PATH_GSL]) m4_include([m4/ax_boost_base.m4]) +m4_include([m4/ax_boost_fileystem.m4]) m4_include([m4/ax_boost_program_options.m4]) +m4_include([m4/ax_boost_serialization.m4]) m4_include([m4/ax_boost_unit_test_framework.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_compare_version.m4]) diff --git a/configure b/configure index 1cd6fdb38..0f093570c 100755 --- a/configure +++ b/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gapc pr1.0. +# Generated by GNU Autoconf 2.71 for gapc pr1.0. # # 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 @@ esac 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 @@ if test "${PATH_SEPARATOR+set}" != set; then 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 @@ case $0 in #(( 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 @@ if test "x$as_myself" = x; then 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 @@ esac 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,53 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } 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 : + 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 +223,21 @@ fi 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 +255,19 @@ esac 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: stefan.janssen@computational.bio.uni-giessen.de about $0: your system, including any error possibly output before $0: this message. Then install a modern shell, or manually @@ -294,6 +295,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -311,6 +313,14 @@ as_fn_exit () 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 +335,7 @@ as_fn_mkdir_p () 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 +344,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 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 +383,13 @@ as_fn_executable_p () # 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 +401,27 @@ fi # as_fn_append # 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 +433,9 @@ as_fn_error () 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 +462,7 @@ as_me=`$as_basename -- "$0" || $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 +506,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits 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 +520,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits 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 +537,13 @@ case `echo -n x` in #((((( 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 @@ -587,49 +618,45 @@ PACKAGE_URL='' # 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_cxx_list= enable_option_checking=no ac_subst_vars='LTLIBOBJS subdirs LIBOBJS -EGREP -CXXCPP GSL_LIBS GSL_CFLAGS GSL_CONFIG +BOOST_SERIALIZATION_LIB +BOOST_FILESYSTEM_LIB BOOST_UNIT_TEST_FRAMEWORK_LIB BOOST_PROGRAM_OPTIONS_LIB BOOST_LDFLAGS @@ -717,6 +744,8 @@ with_boost with_boost_libdir with_boost_program_options with_boost_unit_test_framework +with_boost_filesystem +with_boost_serialization with_gsl_prefix with_gsl_exec_prefix enable_gsltest @@ -732,8 +761,7 @@ CPPFLAGS CCC CC CFLAGS -PIC_FLAGS -CXXCPP' +PIC_FLAGS' ac_subdirs_all='librna' # Initialize some variables set by options. @@ -802,8 +830,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -844,9 +870,9 @@ do 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" @@ -870,9 +896,9 @@ do 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" @@ -1083,9 +1109,9 @@ do 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" @@ -1099,9 +1125,9 @@ do 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" @@ -1145,9 +1171,9 @@ Try \`$0 --help' for more information" *) # 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}" ;; @@ -1163,7 +1189,7 @@ if test -n "$ac_unrecognized_opts"; then 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 @@ -1227,7 +1253,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 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 @@ -1385,6 +1411,15 @@ Optional Packages: is possible to specify a certain library for the linker e.g. --with-boost-unit-test-framework=boost_unit_test_framework-gcc + --with-boost-filesystem[=special-lib] + use the Filesystem library from boost - it is + possible to specify a certain library for the linker + e.g. --with-boost-filesystem=boost_filesystem-gcc-mt + --with-boost-serialization[=special-lib] + use the Serialization library from boost - it is + possible to specify a certain library for the linker + e.g. + --with-boost-serialization=boost_serialization-gcc-mt-d-1_33_1 --with-gsl-prefix=PFX Prefix where GSL is installed (optional) --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional) @@ -1399,7 +1434,6 @@ Some influential environment variables: CC C compiler command CFLAGS C compiler flags PIC_FLAGS compiler flags for PIC code - CXXCPP 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. @@ -1420,9 +1454,9 @@ if test "$ac_init_help" = "recursive"; then 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/ ;; @@ -1450,7 +1484,8 @@ esac 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 @@ -1458,7 +1493,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix 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 @@ -1468,9 +1503,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF gapc configure pr1.0 -generated by GNU Autoconf 2.69 +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 @@ -1487,14 +1522,14 @@ fi 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 @@ -1502,14 +1537,15 @@ $as_echo "$ac_try_echo"; } >&5 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 @@ -1525,14 +1561,14 @@ fi 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 @@ -1540,14 +1576,15 @@ $as_echo "$ac_try_echo"; } >&5 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 @@ -1563,14 +1600,14 @@ fi ac_fn_cxx_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 @@ -1578,17 +1615,18 @@ $as_echo "$ac_try_echo"; } >&5 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_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 @@ -1605,8 +1643,8 @@ fi # ac_fn_cxx_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_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1616,25 +1654,26 @@ case "(($ac_try" in *) 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 @@ -1652,17 +1691,18 @@ fi ac_fn_cxx_check_type () { 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 eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -1670,12 +1710,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -1683,59 +1724,23 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=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 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_cxx_check_type -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_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_cxx_preproc_warn_flag$ac_cxx_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_cxx_try_cpp - # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1743,26 +1748,28 @@ fi ac_fn_cxx_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_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_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_cxx_check_header_compile @@ -1774,11 +1781,12 @@ $as_echo "$ac_res" >&6; } ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +printf %s "checking for int$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. @@ -1789,7 +1797,7 @@ else $ac_includes_default enum { N = $2 / 2 - 1 }; int -main () +main (void) { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; @@ -1799,13 +1807,14 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int -main () +main (void) { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; @@ -1816,9 +1825,10 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( @@ -1826,19 +1836,20 @@ else eval "$3=\$ac_type" ;; esac 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 - if eval test \"x\$"$3"\" = x"no"; then : +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : -else +else $as_nop break fi done 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_find_intX_t @@ -1850,11 +1861,12 @@ $as_echo "$ac_res" >&6; } ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +printf %s "checking for uint$2_t... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. @@ -1864,7 +1876,7 @@ else /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; @@ -1874,7 +1886,8 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( @@ -1882,123 +1895,34 @@ if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=\$ac_type" ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no" +then : -else +else $as_nop break fi done 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_find_uintX_t -# ac_fn_cxx_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_cxx_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_cxx_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_cxx_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_cxx_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 stefan.janssen@computational.bio.uni-giessen.de ## -## -------------------------------------------------------------- ##" - ) | 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_cxx_check_header_mongrel - # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_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. @@ -2006,16 +1930,9 @@ else #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. @@ -2033,35 +1950,56 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_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_cxx_check_func +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 gapc $as_me pr1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2094,8 +2032,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -2130,7 +2072,7 @@ do | -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'" ;; @@ -2165,11 +2107,13 @@ done # 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 @@ -2180,8 +2124,8 @@ trap 'exit_status=$? 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) ;; #( @@ -2205,7 +2149,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2213,14 +2157,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; 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 @@ -2228,15 +2172,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; 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 @@ -2244,8 +2188,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; 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 && @@ -2259,63 +2203,48 @@ ac_signal=0 # 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 @@ -2325,147 +2254,754 @@ if test -r "$cache_file"; then # 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 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 -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 +// 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; -ac_config_files="$ac_config_files config.mf" +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); +} +' -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 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 -# 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. +namespace cxx11test +{ + constexpr int get_val() { return 20; } + struct testinit + { + int i; + double d; + }; -# 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 + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} -{ $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 + virtual int getval() { return this->n; }; + protected: + int n; + }; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac + 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; +} +" + +# 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 + +#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]); +' + +# 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 + +#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; + +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; +} + +// 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; +} +" + +as_fn_append ac_header_cxx_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_cxx_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_cxx_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_cxx_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_cxx_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_cxx_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_cxx_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_cxx_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_cxx_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 + + + +ac_config_files="$ac_config_files config.mf" + + + + + + + + + # 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;; +esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build @@ -2480,21 +3016,22 @@ IFS=$ac_save_IFS 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;; @@ -2520,11 +3057,12 @@ for ac_prog in bash sh ksh93 ksh 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_SHELL+:} 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_SHELL+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $SHELL in [\\/]* | ?:[\\/]*) ac_cv_path_SHELL="$SHELL" # Let the user override the test with a path. @@ -2534,11 +3072,15 @@ else 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_SHELL="$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_SHELL="$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 @@ -2550,11 +3092,11 @@ esac fi SHELL=$ac_cv_path_SHELL if test -n "$SHELL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELL" >&5 -$as_echo "$SHELL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHELL" >&5 +printf "%s\n" "$SHELL" >&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 @@ -2565,12 +3107,13 @@ done ## compile and optimize flags # Check whether --enable---debug was given. -if test "${enable___debug+set}" = set; then : +if test ${enable___debug+y} +then : enableval=$enable___debug; CFLAGS+=" -g " CXXFLAGS+=" -g " -else +else $as_nop CFLAGS+=" -O3 " CXXFLAGS+=" -O3 " @@ -2582,7 +3125,13 @@ fi CFLAGS+="-I librna/" ## get compiler -ac_ext=cpp + + + + + + +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -2592,15 +3141,16 @@ if test -z "$CXX"; then 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 @@ -2608,11 +3158,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -2623,11 +3177,11 @@ fi 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 @@ -2636,15 +3190,16 @@ fi 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 @@ -2652,11 +3207,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -2667,11 +3226,11 @@ fi 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 @@ -2683,8 +3242,8 @@ done 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 @@ -2694,7 +3253,7 @@ fi 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 @@ -2704,7 +3263,7 @@ case "(($ac_try" in *) 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 @@ -2714,7 +3273,7 @@ $as_echo "$ac_try_echo"; } >&5 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 @@ -2722,7 +3281,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -2734,9 +3293,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # 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.*" @@ -2757,11 +3316,12 @@ case "(($ac_try" in *) 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, @@ -2778,7 +3338,7 @@ do # 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 @@ -2794,44 +3354,46 @@ do 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 @@ -2845,15 +3407,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) 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 @@ -2862,7 +3424,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -2874,8 +3436,8 @@ _ACEOF 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 @@ -2883,10 +3445,10 @@ case "(($ac_try" in *) 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 @@ -2894,39 +3456,40 @@ $as_echo "$ac_try_echo"; } >&5 *) 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) { ; @@ -2940,11 +3503,12 @@ case "(($ac_try" in *) 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 @@ -2953,31 +3517,32 @@ $as_echo "$ac_try_echo"; } >&5 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_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 @@ -2987,29 +3552,33 @@ main () 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 @@ -3018,57 +3587,60 @@ else /* 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 @@ -3083,12 +3655,115 @@ else 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_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx11=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_cxx98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx98=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 + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3097,11 +3772,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 @@ -3109,11 +3785,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -3124,11 +3804,11 @@ 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; } + { 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 @@ -3137,11 +3817,12 @@ if test -z "$ac_cv_prog_CC"; then 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 @@ -3149,11 +3830,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -3164,11 +3849,11 @@ fi 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 @@ -3176,8 +3861,8 @@ fi 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 @@ -3190,11 +3875,12 @@ if test -z "$CC"; then 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 @@ -3202,11 +3888,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -3217,11 +3907,11 @@ 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; } + { 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 @@ -3230,11 +3920,12 @@ fi 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 @@ -3243,15 +3934,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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 @@ -3267,18 +3962,18 @@ if test $ac_prog_rejected = yes; then # 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 - { $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 @@ -3289,11 +3984,12 @@ if test -z "$CC"; then 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 +{ 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 @@ -3301,11 +3997,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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$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 @@ -3316,11 +4016,11 @@ 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; } + { 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 @@ -3333,11 +4033,12 @@ if test -z "$CC"; then 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 +{ 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 @@ -3345,11 +4046,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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="$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 @@ -3360,11 +4065,11 @@ fi 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 @@ -3376,34 +4081,138 @@ done 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 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # 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 +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}clang" + 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 + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # 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 +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="clang" + 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 + + 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 +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 @@ -3413,20 +4222,21 @@ $as_echo "$ac_try_echo"; } >&5 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_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 @@ -3436,29 +4246,33 @@ main () 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 @@ -3467,57 +4281,60 @@ else /* 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 @@ -3532,94 +4349,144 @@ else 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 @@ -3630,7 +4497,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ## other programms -# 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 @@ -3644,20 +4512,25 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # 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/* ) ;; @@ -3667,13 +4540,13 @@ case $as_dir/ in #(( # 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 @@ -3681,12 +4554,12 @@ case $as_dir/ in #(( 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 @@ -3702,7 +4575,7 @@ IFS=$as_save_IFS 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 @@ -3712,8 +4585,8 @@ fi 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. @@ -3723,11 +4596,12 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -3741,10 +4615,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -3753,13 +4632,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "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 @@ -3787,8 +4666,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -3801,11 +4680,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -std=c11" >&5 -$as_echo_n "checking whether C compiler accepts -std=c11... " >&6; } -if ${ax_cv_check_cflags___std_c11+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -std=c11" >&5 +printf %s "checking whether C compiler accepts -std=c11... " >&6; } +if test ${ax_cv_check_cflags___std_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -std=c11" @@ -3813,34 +4693,37 @@ else /* 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 : ax_cv_check_cflags___std_c11=yes -else +else $as_nop ax_cv_check_cflags___std_c11=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 CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___std_c11" >&5 -$as_echo "$ax_cv_check_cflags___std_c11" >&6; } -if test "x$ax_cv_check_cflags___std_c11" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___std_c11" >&5 +printf "%s\n" "$ax_cv_check_cflags___std_c11" >&6; } +if test "x$ax_cv_check_cflags___std_c11" = xyes +then : CFLAGS+=" -std=c11" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -std=c99" >&5 -$as_echo_n "checking whether C compiler accepts -std=c99... " >&6; } -if ${ax_cv_check_cflags___std_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -std=c99" >&5 +printf %s "checking whether C compiler accepts -std=c99... " >&6; } +if test ${ax_cv_check_cflags___std_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -std=c99" @@ -3848,28 +4731,30 @@ else /* 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 : ax_cv_check_cflags___std_c99=yes -else +else $as_nop ax_cv_check_cflags___std_c99=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 CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___std_c99" >&5 -$as_echo "$ax_cv_check_cflags___std_c99" >&6; } -if test "x$ax_cv_check_cflags___std_c99" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___std_c99" >&5 +printf "%s\n" "$ax_cv_check_cflags___std_c99" >&6; } +if test "x$ax_cv_check_cflags___std_c99" = xyes +then : CFLAGS+=" -std=c99" -else +else $as_nop echo "C compiler cannot compile C11 or C99 code" exit -1 @@ -3882,11 +4767,12 @@ fi ##fast-math -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 -$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; } -if ${ax_cv_check_cflags___ffast_math+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 +printf %s "checking whether C compiler accepts -ffast-math... " >&6; } +if test ${ax_cv_check_cflags___ffast_math+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ffast-math" @@ -3894,28 +4780,30 @@ else /* 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 : ax_cv_check_cflags___ffast_math=yes -else +else $as_nop ax_cv_check_cflags___ffast_math=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 CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ffast_math" >&5 -$as_echo "$ax_cv_check_cflags___ffast_math" >&6; } -if test "x$ax_cv_check_cflags___ffast_math" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ffast_math" >&5 +printf "%s\n" "$ax_cv_check_cflags___ffast_math" >&6; } +if test "x$ax_cv_check_cflags___ffast_math" = xyes +then : FAST_MATH=" -ffast-math " -else +else $as_nop FAST_MATH=" " echo "-ffast-math not supported by compiler" @@ -3927,10 +4815,11 @@ fi ## test for Position Independednd Code, sets PIC_FLAGS # Check whether --enable-pic was given. -if test "${enable_pic+set}" = set; then : +if test ${enable_pic+y} +then : enableval=$enable_pic; enable_pic="$enableval" test "x$enable_pic" = x && enable_pic=auto -else +else $as_nop enable_pic=auto fi @@ -3940,8 +4829,8 @@ if test "$enable_pic" = auto && test "$enable_static" = yes; then fi # if PIC hasn't been explicitly disabled, try to figure out the flags if test "$enable_pic" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to produce PIC" >&5 -$as_echo_n "checking for $CC option to produce PIC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to produce PIC" >&5 +printf %s "checking for $CC option to produce PIC... " >&6; } # allow the user's flags to override if test "x$PIC_FLAGS" = x; then # see if we're using GCC @@ -4026,8 +4915,8 @@ $as_echo_n "checking for $CC option to produce PIC... " >&6; } esac fi # GCC fi # PIC_FLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PIC_FLAGS" >&5 -$as_echo "$PIC_FLAGS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PIC_FLAGS" >&5 +printf "%s\n" "$PIC_FLAGS" >&6; } fi @@ -4040,11 +4929,12 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -std=c++17" >&5 -$as_echo_n "checking whether C++ compiler accepts -std=c++17... " >&6; } -if ${ax_cv_check_cxxflags___std_cpp17+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -std=c++17" >&5 +printf %s "checking whether C++ compiler accepts -std=c++17... " >&6; } +if test ${ax_cv_check_cxxflags___std_cpp17+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -std=c++17" @@ -4052,38 +4942,41 @@ else /* 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 : ax_cv_check_cxxflags___std_cpp17=yes -else +else $as_nop ax_cv_check_cxxflags___std_cpp17=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 CXXFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___std_cpp17" >&5 -$as_echo "$ax_cv_check_cxxflags___std_cpp17" >&6; } -if test "x$ax_cv_check_cxxflags___std_cpp17" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___std_cpp17" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___std_cpp17" >&6; } +if test "x$ax_cv_check_cxxflags___std_cpp17" = xyes +then : CXXFLAGS+=" -std=c++17" -else +else $as_nop : fi ## test additional flags -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -D_XOPEN_SOURCE=500" >&5 -$as_echo_n "checking whether C++ compiler accepts -D_XOPEN_SOURCE=500... " >&6; } -if ${ax_cv_check_cxxflags___D_XOPEN_SOURCE_500+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -D_XOPEN_SOURCE=500" >&5 +printf %s "checking whether C++ compiler accepts -D_XOPEN_SOURCE=500... " >&6; } +if test ${ax_cv_check_cxxflags___D_XOPEN_SOURCE_500+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -D_XOPEN_SOURCE=500" @@ -4091,35 +4984,38 @@ else /* 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 : ax_cv_check_cxxflags___D_XOPEN_SOURCE_500=yes -else +else $as_nop ax_cv_check_cxxflags___D_XOPEN_SOURCE_500=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 CXXFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___D_XOPEN_SOURCE_500" >&5 -$as_echo "$ax_cv_check_cxxflags___D_XOPEN_SOURCE_500" >&6; } -if test "x$ax_cv_check_cxxflags___D_XOPEN_SOURCE_500" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___D_XOPEN_SOURCE_500" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___D_XOPEN_SOURCE_500" >&6; } +if test "x$ax_cv_check_cxxflags___D_XOPEN_SOURCE_500" = xyes +then : CXXFLAGS+=" -D_XOPEN_SOURCE=500" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -MMD -MP" >&5 -$as_echo_n "checking whether C++ compiler accepts -MMD -MP... " >&6; } -if ${ax_cv_check_cxxflags___MMD__MP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -MMD -MP" >&5 +printf %s "checking whether C++ compiler accepts -MMD -MP... " >&6; } +if test ${ax_cv_check_cxxflags___MMD__MP+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -MMD -MP" @@ -4127,35 +5023,38 @@ else /* 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 : ax_cv_check_cxxflags___MMD__MP=yes -else +else $as_nop ax_cv_check_cxxflags___MMD__MP=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 CXXFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___MMD__MP" >&5 -$as_echo "$ax_cv_check_cxxflags___MMD__MP" >&6; } -if test "x$ax_cv_check_cxxflags___MMD__MP" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___MMD__MP" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___MMD__MP" >&6; } +if test "x$ax_cv_check_cxxflags___MMD__MP" = xyes +then : CXXFLAGS+=" -MMD -MP" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses" >&5 -$as_echo_n "checking whether C++ compiler accepts -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses... " >&6; } -if ${ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses" >&5 +printf %s "checking whether C++ compiler accepts -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses... " >&6; } +if test ${ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses" @@ -4163,26 +5062,28 @@ else /* 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 : ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses=yes -else +else $as_nop ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses=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 CXXFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses" >&5 -$as_echo "$ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses" >&6; } -if test "x$ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses" >&6; } +if test "x$ax_cv_check_cxxflags___Wall__Wnon_virtual_dtor__Wno_unused_variable__Wno_parentheses" = xyes +then : CXXFLAGS+=" -Wall -Wnon-virtual-dtor -Wno-unused-variable -Wno-parentheses" -else +else $as_nop : fi @@ -4190,11 +5091,12 @@ fi ## openmp option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 -$as_echo_n "checking for OpenMP flag of C++ compiler... " >&6; } -if ${ax_cv_cxx_openmp+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 +printf %s "checking for OpenMP flag of C++ compiler... " >&6; } +if test ${ax_cv_cxx_openmp+y} +then : + printf %s "(cached) " >&6 +else $as_nop saveCXXFLAGS=$CXXFLAGS ax_cv_cxx_openmp=unknown # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), @@ -4232,17 +5134,18 @@ main() } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : ax_cv_cxx_openmp=$ax_openmp_flag; break 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 done CXXFLAGS=$saveCXXFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 -$as_echo "$ax_cv_cxx_openmp" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 +printf "%s\n" "$ax_cv_cxx_openmp" >&6; } if test "x$ax_cv_cxx_openmp" = "xunknown"; then : else @@ -4281,11 +5184,12 @@ esac # Extract the first word of "flex", so it can be a program name with args. set dummy flex; 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_FLEX+:} 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_FLEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $FLEX in [\\/]* | ?:[\\/]*) ac_cv_path_FLEX="$FLEX" # Let the user override the test with a path. @@ -4295,11 +5199,15 @@ else 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_FLEX="$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_FLEX="$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 @@ -4311,11 +5219,11 @@ esac fi FLEX=$ac_cv_path_FLEX if test -n "$FLEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 -$as_echo "$FLEX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 +printf "%s\n" "$FLEX" >&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 @@ -4326,11 +5234,12 @@ fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; 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_BISON+:} 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_BISON+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $BISON in [\\/]* | ?:[\\/]*) ac_cv_path_BISON="$BISON" # Let the user override the test with a path. @@ -4340,11 +5249,15 @@ else 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_BISON="$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_BISON="$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 @@ -4356,11 +5269,11 @@ esac fi BISON=$ac_cv_path_BISON if test -n "$BISON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 -$as_echo "$BISON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 +printf "%s\n" "$BISON" >&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 @@ -4372,11 +5285,12 @@ fi # Extract the first word of "hg", so it can be a program name with args. set dummy hg; 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_HG+:} 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_HG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $HG in [\\/]* | ?:[\\/]*) ac_cv_path_HG="$HG" # Let the user override the test with a path. @@ -4386,11 +5300,15 @@ else 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_HG="$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_HG="$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 @@ -4402,21 +5320,22 @@ esac fi HG=$ac_cv_path_HG if test -n "$HG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 -$as_echo "$HG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 +printf "%s\n" "$HG" >&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 ## bison version switch -{ $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 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4424,10 +5343,15 @@ else 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 + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + 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" + 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 @@ -4436,13 +5360,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 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" + printf "%s\n" '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 @@ -4470,8 +5394,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" @@ -4479,11 +5403,12 @@ for ac_prog in gawk mawk nawk awk 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_AWK+:} 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_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -4491,11 +5416,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 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_AWK="$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 @@ -4506,11 +5435,11 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&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 @@ -4521,12 +5450,13 @@ done - if test -n "$BISON"; then : + if test -n "$BISON" +then : ax_bison_version="3.0" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bison version" >&5 -$as_echo_n "checking for bison version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bison version" >&5 +printf %s "checking for bison version... " >&6; } bison_version=`$BISON --version 2>&1 \ | $SED -n -e '/bison (GNU Bison)/b inspect @@ -4534,8 +5464,8 @@ b : inspect s/.* (\{0,1\}\([0-9]*\.[0-9]*\.[0-9]*\))\{0,1\}.*/\1/;p'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bison_version" >&5 -$as_echo "$bison_version" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bison_version" >&5 +printf "%s\n" "$bison_version" >&6; } BISON_VERSION=$bison_version @@ -4583,10 +5513,10 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version fi -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find bison" >&5 -$as_echo "$as_me: WARNING: could not find bison" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not find bison" >&5 +printf "%s\n" "$as_me: WARNING: could not find bison" >&2;} BISON_VERSION_FLAG="" fi @@ -4597,7 +5527,8 @@ fi # Check whether --with-boost was given. -if test "${with_boost+set}" = set; then : +if test ${with_boost+y} +then : withval=$with_boost; if test "$withval" = "no"; then want_boost="no" @@ -4609,7 +5540,7 @@ if test "${with_boost+set}" = set; then : ac_boost_path="$withval" fi -else +else $as_nop want_boost="yes" fi @@ -4617,7 +5548,8 @@ fi # Check whether --with-boost-libdir was given. -if test "${with_boost_libdir+set}" = set; then : +if test ${with_boost_libdir+y} +then : withval=$with_boost_libdir; if test -d "$withval" then @@ -4626,7 +5558,7 @@ if test "${with_boost_libdir+set}" = set; then : as_fn_error $? "--with-boost-libdir expected directory name" "$LINENO" 5 fi -else +else $as_nop ac_boost_lib_path="" fi @@ -4642,8 +5574,8 @@ if test "x$want_boost" = "xyes"; then boost_lib_version_req_sub_minor="0" fi WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= $boost_lib_version_req" >&5 -$as_echo_n "checking for boostlib >= $boost_lib_version_req... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for boostlib >= $boost_lib_version_req" >&5 +printf %s "checking for boostlib >= $boost_lib_version_req... " >&6; } succeeded=no libsubdirs="lib" @@ -4712,7 +5644,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu #include int -main () +main (void) { #if BOOST_VERSION >= $WANT_BOOST_VERSION @@ -4725,15 +5657,16 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } succeeded=yes found_system=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 ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4791,118 +5724,535 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi fi - if test "x$BOOST_ROOT" != "x"; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([0-9]*\.[0-9]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: We will use a staged boost library from $BOOST_ROOT" >&5 -$as_echo "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;} - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" - fi - fi - fi - fi + if test "x$BOOST_ROOT" != "x"; then + for libsubdir in $libsubdirs ; do + if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then + version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` + stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` + stage_version_shorten=`expr $stage_version : '\([0-9]*\.[0-9]*\)'` + V_CHECK=`expr $stage_version_shorten \>\= $_version` + if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: We will use a staged boost library from $BOOST_ROOT" >&5 +printf "%s\n" "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;} + BOOST_CPPFLAGS="-I$BOOST_ROOT" + BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" + fi + fi + fi + fi + + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + succeeded=yes + found_system=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + fi + + if test "$succeeded" != "yes" ; then + if test "$_version" = "0" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&5 +printf "%s\n" "$as_me: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&6;} + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5 +printf "%s\n" "$as_me: Your boost libraries seems to old (version $_version)." >&6;} + fi + # execute ACTION-IF-NOT-FOUND (if present): + + echo "Boost version 1.36 or newer needed to compile GapC" + exit -1 + + else + + + +printf "%s\n" "#define HAVE_BOOST /**/" >>confdefs.h + + # execute ACTION-IF-FOUND (if present): + : + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" +fi + + + +#BOOST_PROGRAM_OPTIONS_LIB + + +# Check whether --with-boost-program-options was given. +if test ${with_boost_program_options+y} +then : + withval=$with_boost_program_options; + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_program_options_lib="" + else + want_boost="yes" + ax_boost_user_program_options_lib="$withval" + fi + +else $as_nop + want_boost="yes" + +fi + + + if test "x$want_boost" = "xyes"; then + + export want_boost + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Program_Options library is available" >&5 +printf %s "checking whether the Boost::Program_Options library is available... " >&6; } +if test ${ax_cv_boost_program_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +boost::program_options::error err("Error message"); + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_boost_program_options=yes +else $as_nop + ax_cv_boost_program_options=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_boost_program_options" >&5 +printf "%s\n" "$ax_cv_boost_program_options" >&6; } + if test "$ax_cv_boost_program_options" = yes; then + +printf "%s\n" "#define HAVE_BOOST_PROGRAM_OPTIONS /**/" >>confdefs.h + + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/[^\/]*//'` + if test "x$ax_boost_user_program_options_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int exit (); +} +int +main (void) +{ +return conftest::exit (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; link_program_options="yes"; break +else $as_nop + link_program_options="no" +fi + + done + if test "x$link_program_options" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int exit (); +} +int +main (void) +{ +return conftest::exit (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; link_program_options="yes"; break +else $as_nop + link_program_options="no" +fi + + done + fi + else + for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_lib" >&5 +printf %s "checking for main in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; link_program_options="yes"; break +else $as_nop + link_program_options="no" +fi + + done + fi + if test "x$ax_lib" = "x"; then + as_fn_error $? "Could not find a version of the library!" "$LINENO" 5 + fi + if test "x$link_program_options" != "xyes"; then + as_fn_error $? "Could not link against $ax_lib !" "$LINENO" 5 + fi + fi + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi + + +#BOOST_UNIT_TEST_FRAMEWORK_LIB + + +# Check whether --with-boost-unit-test-framework was given. +if test ${with_boost_unit_test_framework+y} +then : + withval=$with_boost_unit_test_framework; + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_unit_test_framework_lib="" + else + want_boost="yes" + ax_boost_user_unit_test_framework_lib="$withval" + fi + +else $as_nop + want_boost="yes" + +fi + - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS + if test "x$want_boost" = "xyes"; then - ac_ext=cpp + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Unit_Test_Framework library is available" >&5 +printf %s "checking whether the Boost::Unit_Test_Framework library is available... " >&6; } +if test ${ax_cv_boost_unit_test_framework+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - #include - +#include int -main () +main (void) { - - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - +using boost::unit_test::test_suite; + test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0; ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - succeeded=yes - found_system=yes - +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_boost_unit_test_framework=yes +else $as_nop + ax_cv_boost_unit_test_framework=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&5 -$as_echo "$as_me: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation." >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5 -$as_echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;} - fi - # execute ACTION-IF-NOT-FOUND (if present): - echo "Boost version 1.36 or newer needed to compile GapC" - exit -1 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_boost_unit_test_framework" >&5 +printf "%s\n" "$ax_cv_boost_unit_test_framework" >&6; } + if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then - else +printf "%s\n" "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK /**/" >>confdefs.h + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/[^\/]*//'` + if test "x$ax_boost_user_unit_test_framework_lib" = "x"; then + saved_ldflags="${LDFLAGS}" + for monitor_library in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.so* $BOOSTLIBDIR/libboost_unit_test_framework*.dylib* $BOOSTLIBDIR/libboost_unit_test_framework*.a* 2>/dev/null` ; do + if test -r $monitor_library ; then + libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a.*$;\1;'` + ax_lib=${libextension} + link_unit_test_framework="yes" + else + link_unit_test_framework="no" + fi -$as_echo "#define HAVE_BOOST /**/" >>confdefs.h + if test "x$link_unit_test_framework" = "xyes"; then + BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" - # execute ACTION-IF-FOUND (if present): - : - fi + break + fi + done + if test "x$link_unit_test_framework" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.dll* $BOOSTLIBDIR/boost_unit_test_framework*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_unit_test_framework.*\)\.dll.*$;\1;' -e 's;^\(boost_unit_test_framework.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" +namespace conftest { + extern "C" int exit (); +} +int +main (void) +{ +return conftest::exit (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; link_unit_test_framework="yes"; break +else $as_nop + link_unit_test_framework="no" fi + done + fi + else + link_unit_test_framework="no" + saved_ldflags="${LDFLAGS}" + for ax_lib in boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib $ax_boost_user_unit_test_framework_lib ; do + if test "x$link_unit_test_framework" = "xyes"; then + break; + fi + for unittest_library in `ls $BOOSTLIBDIR/lib${ax_lib}.so* $BOOSTLIBDIR/lib${ax_lib}.a* 2>/dev/null` ; do + if test -r $unittest_library ; then + libextension=`echo $unittest_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'` + ax_lib=${libextension} + link_unit_test_framework="yes" + else + link_unit_test_framework="no" + fi + + if test "x$link_unit_test_framework" = "xyes"; then + BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" + break + fi + done + done + fi + if test "x$ax_lib" = "x"; then + as_fn_error $? "Could not find a version of the library!" "$LINENO" 5 + fi + if test "x$link_unit_test_framework" != "xyes"; then + as_fn_error $? "Could not link against $ax_lib !" "$LINENO" 5 + fi + fi -#BOOST_PROGRAM_OPTIONS_LIB + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi -# Check whether --with-boost-program-options was given. -if test "${with_boost_program_options+set}" = set; then : - withval=$with_boost_program_options; +#BOOST_FILESYSTEM_LIB + + +# Check whether --with-boost-filesystem was given. +if test ${with_boost_filesystem+y} +then : + withval=$with_boost_filesystem; if test "$withval" = "no"; then want_boost="no" elif test "$withval" = "yes"; then want_boost="yes" - ax_boost_user_program_options_lib="" + ax_boost_user_filesystem_lib="" else want_boost="yes" - ax_boost_user_program_options_lib="$withval" + ax_boost_user_filesystem_lib="$withval" fi -else +else $as_nop want_boost="yes" fi @@ -4910,44 +6260,51 @@ fi if test "x$want_boost" = "xyes"; then - export want_boost CPPFLAGS_SAVED="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" export CPPFLAGS + LDFLAGS_SAVED="$LDFLAGS" LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Program_Options library is available" >&5 -$as_echo_n "checking whether the Boost::Program_Options library is available... " >&6; } -if ${ax_cv_boost_program_options+:} false; then : - $as_echo_n "(cached) " >&6 -else + + LIBS_SAVED=$LIBS + LIBS="$LIBS $BOOST_SYSTEM_LIB" + export LIBS + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Filesystem library is available" >&5 +printf %s "checking whether the Boost::Filesystem library is available... " >&6; } +if test ${ax_cv_boost_filesystem+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - +#include int -main () +main (void) { -boost::program_options::error err("Error message"); +using namespace boost::filesystem; + path my_path( "foo/bar/data.txt" ); return 0; ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_boost_program_options=yes -else - ax_cv_boost_program_options=no +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_boost_filesystem=yes +else $as_nop + ax_cv_boost_filesystem=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -4955,181 +6312,188 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_boost_program_options" >&5 -$as_echo "$ax_cv_boost_program_options" >&6; } - if test "$ax_cv_boost_program_options" = yes; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_boost_filesystem" >&5 +printf "%s\n" "$ax_cv_boost_filesystem" >&6; } + if test "x$ax_cv_boost_filesystem" = "xyes"; then -$as_echo "#define HAVE_BOOST_PROGRAM_OPTIONS /**/" >>confdefs.h +printf "%s\n" "#define HAVE_BOOST_FILESYSTEM /**/" >>confdefs.h - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/[^\/]*//'` - if test "x$ax_boost_user_program_options_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; do + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/[^\/]*//'` + if test "x$ax_boost_user_filesystem_lib" = "x"; then + for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do ax_lib=${libextension} - as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 -$as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$ax_lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char exit (); +namespace conftest { + extern "C" int exit (); +} int -main () +main (void) { -return exit (); +return conftest::exit (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=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 LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; link_program_options="yes"; break -else - link_program_options="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_FILESYSTEM_LIB="-l$ax_lib"; link_filesystem="yes"; break +else $as_nop + link_filesystem="no" fi done - if test "x$link_program_options" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a.*$;\1;'` ; do + if test "x$link_filesystem" != "xyes"; then + for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do ax_lib=${libextension} - as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 -$as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$ax_lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char exit (); +namespace conftest { + extern "C" int exit (); +} int -main () +main (void) { -return exit (); +return conftest::exit (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=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 LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; link_program_options="yes"; break -else - link_program_options="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_FILESYSTEM_LIB="-l$ax_lib"; link_filesystem="yes"; break +else $as_nop + link_filesystem="no" fi done - fi - else - for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do - as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_lib" >&5 -$as_echo_n "checking for main in -l$ax_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + fi + else + for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$ax_lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +namespace conftest { + extern "C" int exit (); +} int -main () +main (void) { -return main (); +return conftest::exit (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=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 LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; link_program_options="yes"; break -else - link_program_options="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_FILESYSTEM_LIB="-l$ax_lib"; link_filesystem="yes"; break +else $as_nop + link_filesystem="no" fi done - fi + + fi if test "x$ax_lib" = "x"; then - as_fn_error $? "Could not find a version of the library!" "$LINENO" 5 + as_fn_error $? "Could not find a version of the Boost::Filesystem library!" "$LINENO" 5 fi - if test "x$link_program_options" != "xyes"; then - as_fn_error $? "Could not link against $ax_lib !" "$LINENO" 5 - fi + if test "x$link_filesystem" != "xyes"; then + as_fn_error $? "Could not link against $ax_lib !" "$LINENO" 5 + fi fi + CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + LIBS="$LIBS_SAVED" fi -#BOOST_UNIT_TEST_FRAMEWORK_LIB +#BOOST_SERIALIZATION_LIB -# Check whether --with-boost-unit-test-framework was given. -if test "${with_boost_unit_test_framework+set}" = set; then : - withval=$with_boost_unit_test_framework; +# Check whether --with-boost-serialization was given. +if test ${with_boost_serialization+y} +then : + withval=$with_boost_serialization; if test "$withval" = "no"; then want_boost="no" elif test "$withval" = "yes"; then want_boost="yes" - ax_boost_user_unit_test_framework_lib="" + ax_boost_user_serialization_lib="" else want_boost="yes" - ax_boost_user_unit_test_framework_lib="$withval" + ax_boost_user_serialization_lib="$withval" fi -else +else $as_nop want_boost="yes" fi @@ -5139,17 +6503,20 @@ fi CPPFLAGS_SAVED="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: BOOST_CPPFLAGS $BOOST_CPPFLAGS" >&5 +printf "%s\n" "$as_me: WARNING: BOOST_CPPFLAGS $BOOST_CPPFLAGS" >&2;} export CPPFLAGS LDFLAGS_SAVED="$LDFLAGS" LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" export LDFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Unit_Test_Framework library is available" >&5 -$as_echo_n "checking whether the Boost::Unit_Test_Framework library is available... " >&6; } -if ${ax_cv_boost_unit_test_framework+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Serialization library is available" >&5 +printf %s "checking whether the Boost::Serialization library is available... " >&6; } +if test ${ax_cv_boost_serialization+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5158,22 +6525,28 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include + #include + #include + int -main () +main (void) { -using boost::unit_test::test_suite; - test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0; +std::ofstream ofs("filename"); + boost::archive::text_oarchive oa(ofs); + return 0; + ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_boost_unit_test_framework=yes -else - ax_cv_boost_unit_test_framework=no +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_boost_serialization=yes +else $as_nop + ax_cv_boost_serialization=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_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5182,108 +6555,162 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_boost_unit_test_framework" >&5 -$as_echo "$ax_cv_boost_unit_test_framework" >&6; } - if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_boost_serialization" >&5 +printf "%s\n" "$ax_cv_boost_serialization" >&6; } + if test "x$ax_cv_boost_serialization" = "xyes"; then -$as_echo "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK /**/" >>confdefs.h +printf "%s\n" "#define HAVE_BOOST_SERIALIZATION /**/" >>confdefs.h BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/[^\/]*//'` + ax_lib= + if test "x$ax_boost_user_serialization_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_serialization*.so* $BOOSTLIBDIR/libboost_serialization*.dylib* $BOOSTLIBDIR/libboost_serialization*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_serialization.*\)\.so.*$;\1;' -e 's;^lib\(boost_serialization.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_serialization.*\)\.a*$;\1;'` ; do + ax_lib=${libextension} + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "x$ax_boost_user_unit_test_framework_lib" = "x"; then - saved_ldflags="${LDFLAGS}" - for monitor_library in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.so* $BOOSTLIBDIR/libboost_unit_test_framework*.dylib* $BOOSTLIBDIR/libboost_unit_test_framework*.a* 2>/dev/null` ; do - if test -r $monitor_library ; then - libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a.*$;\1;'` - ax_lib=${libextension} - link_unit_test_framework="yes" - else - link_unit_test_framework="no" - fi - - if test "x$link_unit_test_framework" = "xyes"; then - BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" +namespace conftest { + extern "C" int exit (); +} +int +main (void) +{ +return conftest::exit (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_SERIALIZATION_LIB="-l$ax_lib"; link_serialization="yes"; break +else $as_nop + link_serialization="no" +fi - break - fi - done - if test "x$link_unit_test_framework" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.dll* $BOOSTLIBDIR/boost_unit_test_framework*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_unit_test_framework.*\)\.dll.*$;\1;' -e 's;^\(boost_unit_test_framework.*\)\.a.*$;\1;'` ; do + done + if test "x$link_serialization" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_serialization*.dll* $BOOSTLIBDIR/boost_serialization*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_serialization.*\)\.dll.*$;\1;' -e 's;^\(boost_serialization.*\)\.a.*$;\1;'` ; do ax_lib=${libextension} - as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 -$as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_exit" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 +printf %s "checking for exit in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$ax_lib $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char exit (); +namespace conftest { + extern "C" int exit (); +} int -main () +main (void) { -return exit (); +return conftest::exit (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=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 LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; link_unit_test_framework="yes"; break -else - link_unit_test_framework="no" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_SERIALIZATION_LIB="-l$ax_lib"; link_serialization="yes"; break +else $as_nop + link_serialization="no" fi done fi + else - link_unit_test_framework="no" - saved_ldflags="${LDFLAGS}" - for ax_lib in boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib $ax_boost_user_unit_test_framework_lib ; do - if test "x$link_unit_test_framework" = "xyes"; then - break; - fi - for unittest_library in `ls $BOOSTLIBDIR/lib${ax_lib}.so* $BOOSTLIBDIR/lib${ax_lib}.a* 2>/dev/null` ; do - if test -r $unittest_library ; then - libextension=`echo $unittest_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'` - ax_lib=${libextension} - link_unit_test_framework="yes" - else - link_unit_test_framework="no" - fi + for ax_lib in $ax_boost_user_serialization_lib boost_serialization-$ax_boost_user_serialization_lib; do + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$ax_lib""_main" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_lib" >&5 +printf %s "checking for main in -l$ax_lib... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$ax_lib $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "x$link_unit_test_framework" = "xyes"; then - BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" +namespace conftest { + extern "C" int main (); +} +int +main (void) +{ +return conftest::main (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else $as_nop + eval "$as_ac_Lib=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +eval ac_res=\$$as_ac_Lib + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BOOST_SERIALIZATION_LIB="-l$ax_lib"; link_serialization="yes"; break +else $as_nop + link_serialization="no" +fi - break - fi done - done + fi if test "x$ax_lib" = "x"; then - as_fn_error $? "Could not find a version of the library!" "$LINENO" 5 + as_fn_error $? "Could not find a version of the Boost::Serialization library!" "$LINENO" 5 fi - if test "x$link_unit_test_framework" != "xyes"; then + if test "x$link_serialization" != "xyes"; then as_fn_error $? "Could not link against $ax_lib !" "$LINENO" 5 fi fi @@ -5297,24 +6724,27 @@ fi # Check whether --with-gsl-prefix was given. -if test "${with_gsl_prefix+set}" = set; then : +if test ${with_gsl_prefix+y} +then : withval=$with_gsl_prefix; gsl_prefix="$withval" -else +else $as_nop gsl_prefix="" fi # Check whether --with-gsl-exec-prefix was given. -if test "${with_gsl_exec_prefix+set}" = set; then : +if test ${with_gsl_exec_prefix+y} +then : withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval" -else +else $as_nop gsl_exec_prefix="" fi # Check whether --enable-gsltest was given. -if test "${enable_gsltest+set}" = set; then : +if test ${enable_gsltest+y} +then : enableval=$enable_gsltest; -else +else $as_nop enable_gsltest=yes fi @@ -5330,11 +6760,12 @@ fi # Extract the first word of "gsl-config", so it can be a program name with args. set dummy gsl-config; 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_GSL_CONFIG+:} 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_GSL_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $GSL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test with a path. @@ -5344,11 +6775,15 @@ else 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_GSL_CONFIG="$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_GSL_CONFIG="$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 @@ -5361,17 +6796,17 @@ esac fi GSL_CONFIG=$ac_cv_path_GSL_CONFIG if test -n "$GSL_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5 -$as_echo "$GSL_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5 +printf "%s\n" "$GSL_CONFIG" >&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 min_gsl_version=1.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5 -$as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5 +printf %s "checking for GSL - version >= $min_gsl_version... " >&6; } no_gsl="" if test "$GSL_CONFIG" = "no" ; then no_gsl=yes @@ -5404,9 +6839,10 @@ $as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; } LIBS="$LIBS $GSL_LIBS" rm -f conf.gsltest - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : echo $ac_n "cross compiling; assumed OK... $ac_c" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5446,554 +6882,306 @@ int main (void) n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) ; if (n != 2 && n != 3) { - printf("%s, bad version string\n", "$min_gsl_version"); - exit(1); - } - - if (($gsl_major_version > major) || - (($gsl_major_version == major) && ($gsl_minor_version > minor)) || - (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro))) - { - exit(0); - } - else - { - exit(1); - } -} - - -_ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - -else - no_gsl=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_gsl" = x ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - : - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "$GSL_CONFIG" = "no" ; then - echo "*** The gsl-config script installed by GSL could not be found" - echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the GSL_CONFIG environment variable to the" - echo "*** full path to gsl-config." - else - if test -f conf.gsltest ; then - : - else - echo "*** Could not run GSL test program, checking why..." - CFLAGS="$CFLAGS $GSL_CFLAGS" - LIBS="$LIBS $GSL_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include - -int -main () -{ - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding GSL or finding the wrong" - echo "*** version of GSL. If it is not finding GSL, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" -else - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means GSL was incorrectly installed" - echo "*** or that you have moved GSL since it was installed. In the latter case, you" - echo "*** may want to edit the gsl-config script: $GSL_CONFIG" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi -# GSL_CFLAGS="" -# GSL_LIBS="" - - echo "GSL needed to compile GapC" - exit -1 - - fi - - - rm -f conf.gsltest - - - -# Checks for typedefs, structures, and compiler characteristics. -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_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; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_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_cxx_try_cpp "$LINENO"; then : - -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_cxx_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 : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_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_cxx_try_cpp "$LINENO"; then : - -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_cxx_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 \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -{ $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 + printf("%s, bad version string\n", "$min_gsl_version"); + exit(1); + } - $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 + if (($gsl_major_version > major) || + (($gsl_major_version == major) && ($gsl_minor_version > minor)) || + (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro))) + { + exit(0); + } + else + { + exit(1); + } +} - 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" +_ACEOF +if ac_fn_cxx_try_run "$LINENO" +then : -{ $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 +else $as_nop + no_gsl=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gsl" = x ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + : + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "$GSL_CONFIG" = "no" ; then + echo "*** The gsl-config script installed by GSL could not be found" + echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GSL_CONFIG environment variable to the" + echo "*** full path to gsl-config." + else + if test -f conf.gsltest ; then + : + else + echo "*** Could not run GSL test program, checking why..." + CFLAGS="$CFLAGS $GSL_CFLAGS" + LIBS="$LIBS $GSL_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include + +#include int -main () +main (void) { - + return 0; ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no +if ac_fn_cxx_try_link "$LINENO" +then : + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GSL or finding the wrong" + echo "*** version of GSL. If it is not finding GSL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else $as_nop + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GSL was incorrectly installed" + echo "*** or that you have moved GSL since it was installed. In the latter case, you" + echo "*** may want to edit the gsl-config script: $GSL_CONFIG" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi +# GSL_CFLAGS="" +# GSL_LIBS="" -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 + echo "GSL needed to compile GapC" + exit -1 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : + fi -else - ac_cv_header_stdc=no -fi -rm -f conftest* -fi + rm -f conf.gsltest -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 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* +# Checks for typedefs, structures, and compiler characteristics. +ac_header= ac_cache= +for ac_item in $ac_header_cxx_list +do + if test $ac_cache; then + ac_fn_cxx_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 -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 -/* 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 () -{ - 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_cxx_try_run "$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 -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 -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -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_cxx_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 $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi +ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes +then : -done +printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +printf %s "checking for stdbool.h that conforms to C99... " >&6; } +if test ${ac_cv_header_stdbool_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" + #ifndef __bool_true_false_are_defined + #error "__bool_true_false_are_defined is not defined" #endif - #ifndef true - "error: true is not defined" + char a[__bool_true_false_are_defined == 1 ? 1 : -1]; + + /* Regardless of whether this is C++ or "_Bool" is a + valid type name, "true" and "false" should be usable + in #if expressions and integer constant expressions, + and "bool" should be a valid type name. */ + + #if !true + #error "'true' is not true" #endif #if true != 1 - "error: true is not 1" + #error "'true' is not equal to 1" #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" + char b[true == 1 ? 1 : -1]; + char c[true]; + + #if false + #error "'false' is not false" #endif + #if false != 0 + #error "'false' is not equal to 0" + #endif + char d[false == 0 ? 1 : -1]; + + enum { e = false, f = true, g = false * true, h = true * 256 }; + + char i[(bool) 0.5 == true ? 1 : -1]; + char j[(bool) 0.0 == false ? 1 : -1]; + char k[sizeof (bool) > 0 ? 1 : -1]; + + struct sb { bool s: 1; bool t; } s; + char l[sizeof s.t > 0 ? 1 : -1]; - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + bool m[h]; + char n[sizeof m == h * sizeof m[0] ? 1 : -1]; + char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ - _Bool q = true; - _Bool *pq = &q; + bool p = true; + bool *pp = &p; + + /* C 1999 specifies that bool, true, and false are to be + macros, but C++ 2011 and later overrule this. */ + #if __cplusplus < 201103 + #ifndef bool + #error "bool is not defined" + #endif + #ifndef false + #error "false is not defined" + #endif + #ifndef true + #error "true is not defined" + #endif + #endif + + /* If _Bool is available, repeat with it all the tests + above that used bool. */ + #ifdef HAVE__BOOL + struct sB { _Bool s: 1; _Bool t; } t; + + char q[(_Bool) 0.5 == true ? 1 : -1]; + char r[(_Bool) 0.0 == false ? 1 : -1]; + char u[sizeof (_Bool) > 0 ? 1 : -1]; + char v[sizeof t.t > 0 ? 1 : -1]; + + _Bool w[h]; + char x[sizeof m == h * sizeof m[0] ? 1 : -1]; + char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; + _Bool z = true; + _Bool *pz = &p; + #endif int -main () +main (void) { - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); + bool ps = &s; + *pp |= p; + *pp |= ! p; + + #ifdef HAVE__BOOL + _Bool pt = &t; + *pz |= z; + *pz |= ! z; + #endif + + /* Refer to every declared value, so they cannot be + discarded as unused. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + + !l + !m + !n + !o + !p + !pp + !ps + #ifdef HAVE__BOOL + + !q + !r + !u + !v + !w + !x + !y + !z + !pt + #endif + ); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_header_stdbool_h=yes -else +else $as_nop ac_cv_header_stdbool_h=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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi -{ $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_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_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) ;; @@ -6010,16 +7198,17 @@ _ACEOF ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -6032,7 +7221,7 @@ main () /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -6060,7 +7249,7 @@ main () iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -6076,18 +7265,19 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi @@ -6096,9 +7286,7 @@ case $ac_cv_c_int16_t in #( no|yes) ;; #( *) -cat >>confdefs.h <<_ACEOF -#define int16_t $ac_cv_c_int16_t -_ACEOF +printf "%s\n" "#define int16_t $ac_cv_c_int16_t" >>confdefs.h ;; esac @@ -6107,9 +7295,7 @@ case $ac_cv_c_int32_t in #( no|yes) ;; #( *) -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF +printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h ;; esac @@ -6118,66 +7304,67 @@ case $ac_cv_c_int8_t in #( no|yes) ;; #( *) -cat >>confdefs.h <<_ACEOF -#define int8_t $ac_cv_c_int8_t -_ACEOF +printf "%s\n" "#define int8_t $ac_cv_c_int8_t" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 -$as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if ${ac_cv_c_restrict+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +printf %s "checking for C/C++ restrict keyword... " >&6; } +if test ${ac_cv_c_restrict+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - for ac_kw in __restrict __restrict__ _Restrict restrict; do + # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: + # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html + # Put 'restrict' last, because C++ lacks it. + for ac_kw in __restrict__ __restrict _Restrict restrict; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - } +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + int -main () +main (void) { int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_c_restrict=$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_restrict" != no && break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 -$as_echo "$ac_cv_c_restrict" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +printf "%s\n" "$ac_cv_c_restrict" >&6; } case $ac_cv_c_restrict in restrict) ;; - no) $as_echo "#define restrict /**/" >>confdefs.h + no) printf "%s\n" "#define restrict /**/" >>confdefs.h ;; - *) cat >>confdefs.h <<_ACEOF -#define restrict $ac_cv_c_restrict -_ACEOF + *) printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h ;; esac ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi @@ -6187,9 +7374,7 @@ case $ac_cv_c_uint16_t in #( *) -cat >>confdefs.h <<_ACEOF -#define uint16_t $ac_cv_c_uint16_t -_ACEOF +printf "%s\n" "#define uint16_t $ac_cv_c_uint16_t" >>confdefs.h ;; esac @@ -6198,12 +7383,10 @@ case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) -$as_echo "#define _UINT32_T 1" >>confdefs.h +printf "%s\n" "#define _UINT32_T 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF +printf "%s\n" "#define uint32_t $ac_cv_c_uint32_t" >>confdefs.h ;; esac @@ -6212,12 +7395,10 @@ case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) -$as_echo "#define _UINT64_T 1" >>confdefs.h +printf "%s\n" "#define _UINT64_T 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t -_ACEOF +printf "%s\n" "#define uint64_t $ac_cv_c_uint64_t" >>confdefs.h ;; esac @@ -6226,42 +7407,42 @@ case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) -$as_echo "#define _UINT8_T 1" >>confdefs.h +printf "%s\n" "#define _UINT8_T 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF +printf "%s\n" "#define uint8_t $ac_cv_c_uint8_t" >>confdefs.h ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 -$as_echo_n "checking for error_at_line... " >&6; } -if ${ac_cv_lib_error_at_line+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 +printf %s "checking for error_at_line... " >&6; } +if test ${ac_cv_lib_error_at_line+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : ac_cv_lib_error_at_line=yes -else +else $as_nop ac_cv_lib_error_at_line=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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 -$as_echo "$ac_cv_lib_error_at_line" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 +printf "%s\n" "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; @@ -6271,45 +7452,42 @@ esac fi -for ac_header in stdlib.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if ${ac_cv_func_malloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +printf %s "checking for GNU libc compatible malloc... " >&6; } +if test ${ac_cv_func_malloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif +#include int -main () +main (void) { -return ! malloc (0); +void *p = malloc (0); + int result = !p; + free (p); + return result; ; return 0; } _ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO" +then : ac_cv_func_malloc_0_nonnull=yes -else +else $as_nop ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -6317,14 +7495,15 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes +then : -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h +printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h +else $as_nop + printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; @@ -6333,24 +7512,26 @@ else esac -$as_echo "#define malloc rpl_malloc" >>confdefs.h +printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 -$as_echo_n "checking for working memcmp... " >&6; } -if ${ac_cv_func_memcmp_working+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +printf %s "checking for working memcmp... " >&6; } +if test ${ac_cv_func_memcmp_working+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_func_memcmp_working=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Some versions of memcmp are not 8-bit clean. */ @@ -6381,9 +7562,10 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO" +then : ac_cv_func_memcmp_working=yes -else +else $as_nop ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -6391,8 +7573,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 -$as_echo "$ac_cv_func_memcmp_working" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +printf "%s\n" "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" @@ -6400,45 +7582,42 @@ test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in esac -for ac_header in stdlib.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 -$as_echo_n "checking for GNU libc compatible realloc... " >&6; } -if ${ac_cv_func_realloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_realloc_0_nonnull=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +printf %s "checking for GNU libc compatible realloc... " >&6; } +if test ${ac_cv_func_realloc_0_nonnull+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | hpux* | solaris* | cygwin* | mingw* | msys* ) + ac_cv_func_realloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_realloc_0_nonnull=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif +#include int -main () +main (void) { -return ! realloc (0, 0); +void *p = realloc (0, 0); + int result = !p; + free (p); + return result; ; return 0; } _ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO" +then : ac_cv_func_realloc_0_nonnull=yes -else +else $as_nop ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -6446,14 +7625,15 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +printf "%s\n" "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes +then : -$as_echo "#define HAVE_REALLOC 1" >>confdefs.h +printf "%s\n" "#define HAVE_REALLOC 1" >>confdefs.h -else - $as_echo "#define HAVE_REALLOC 0" >>confdefs.h +else $as_nop + printf "%s\n" "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; @@ -6462,22 +7642,23 @@ else esac -$as_echo "#define realloc rpl_realloc" >>confdefs.h +printf "%s\n" "#define realloc rpl_realloc" >>confdefs.h fi -for ac_func in memset strerror -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_cxx_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 +ac_fn_cxx_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + +fi +ac_fn_cxx_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h fi -done # compile flags for ViennaRNA part @@ -6517,8 +7698,8 @@ _ACEOF 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) ;; #( @@ -6548,15 +7729,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^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 @@ -6570,8 +7751,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} 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 @@ -6624,7 +7805,7 @@ U= 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" @@ -6640,8 +7821,8 @@ LTLIBOBJS=$ac_ltlibobjs 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 @@ -6664,14 +7845,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # 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 ;; #( @@ -6681,46 +7864,46 @@ esac 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 || @@ -6729,13 +7912,6 @@ if test "${PATH_SEPARATOR+set}" != set; then 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 #(( @@ -6744,8 +7920,12 @@ case $0 in #(( 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 @@ -6757,30 +7937,10 @@ if test "x$as_myself" = x; then 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] @@ -6793,13 +7953,14 @@ as_fn_error () 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. @@ -6826,18 +7987,20 @@ as_fn_unset () { 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 @@ -6849,12 +8012,13 @@ fi # as_fn_append # 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` @@ -6885,7 +8049,7 @@ as_me=`$as_basename -- "$0" || $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 @@ -6907,6 +8071,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS 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*) @@ -6920,6 +8088,12 @@ case `echo -n x` in #((((( 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 @@ -6961,7 +8135,7 @@ as_fn_mkdir_p () 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" @@ -6970,7 +8144,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 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 @@ -7033,7 +8207,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by gapc $as_me pr1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7082,14 +8256,16 @@ $config_files Report bugs to ." _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="\\ gapc config.status pr1.0 -configured by $0, generated by GNU Autoconf 2.69, +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." @@ -7128,21 +8304,21 @@ do -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'" ac_need_defaults=false;; --he | --h | --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=: ;; @@ -7170,7 +8346,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 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 "\$@" @@ -7184,7 +8360,7 @@ exec 5>>config.log 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 @@ -7209,7 +8385,7 @@ done # 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_FILES+y} || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree @@ -7437,7 +8613,7 @@ do 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 @@ -7445,17 +8621,17 @@ do # 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 @@ -7472,7 +8648,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 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 @@ -7496,9 +8672,9 @@ $as_echo X"$ac_file" | 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/ ;; @@ -7555,8 +8731,8 @@ ac_sed_dataroot=' 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=' @@ -7599,9 +8775,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { 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" @@ -7687,7 +8863,7 @@ if test "$no_recursion" != yes; then ;; *) case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac @@ -7697,7 +8873,7 @@ if test "$no_recursion" != yes; then # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" @@ -7718,17 +8894,17 @@ if test "$no_recursion" != yes; then test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 - $as_echo "$ac_msg" >&6 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + printf "%s\n" "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. 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/ ;; @@ -7758,17 +8934,15 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" - # Check for guested configure; otherwise get Cygnus style 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 ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 -$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi @@ -7781,8 +8955,8 @@ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || @@ -7793,7 +8967,8 @@ $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cach done 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 --git a/configure.ac b/configure.ac index 89e47c060..14e79eb05 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,12 @@ AX_BOOST_PROGRAM_OPTIONS #BOOST_UNIT_TEST_FRAMEWORK_LIB AX_BOOST_UNIT_TEST_FRAMEWORK +#BOOST_FILESYSTEM_LIB +AX_BOOST_FILESYSTEM + +#BOOST_SERIALIZATION_LIB +AX_BOOST_SERIALIZATION + ## GSL , GSL_LIBS, GSL_CFLAGS AX_PATH_GSL([1.0],[], [ diff --git a/m4/ax_boost_fileystem.m4 b/m4/ax_boost_fileystem.m4 new file mode 100644 index 000000000..8c9c5ccbb --- /dev/null +++ b/m4/ax_boost_fileystem.m4 @@ -0,0 +1,119 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_FILESYSTEM +# +# DESCRIPTION +# +# Test for Filesystem library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. Further documentation is +# available at . +# +# This macro calls: +# +# AC_SUBST(BOOST_FILESYSTEM_LIB) +# +# And sets: +# +# HAVE_BOOST_FILESYSTEM +# +# LICENSE +# +# Copyright (c) 2009 Thomas Porschberg +# Copyright (c) 2009 Michael Tindal +# Copyright (c) 2009 Roman Rybalko +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 28 + +AC_DEFUN([AX_BOOST_FILESYSTEM], +[ + AC_ARG_WITH([boost-filesystem], + AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@], + [use the Filesystem library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_filesystem_lib="" + else + want_boost="yes" + ax_boost_user_filesystem_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + LIBS_SAVED=$LIBS + LIBS="$LIBS $BOOST_SYSTEM_LIB" + export LIBS + + AC_CACHE_CHECK(whether the Boost::Filesystem library is available, + ax_cv_boost_filesystem, + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[using namespace boost::filesystem; + path my_path( "foo/bar/data.txt" ); + return 0;]])], + ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_filesystem" = "xyes"; then + AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + if test "x$ax_boost_user_filesystem_lib" = "x"; then + for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], + [link_filesystem="no"]) + done + if test "x$link_filesystem" != "xyes"; then + for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], + [link_filesystem="no"]) + done + fi + else + for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do + AC_CHECK_LIB($ax_lib, exit, + [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], + [link_filesystem="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the Boost::Filesystem library!) + fi + if test "x$link_filesystem" != "xyes"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + LIBS="$LIBS_SAVED" + fi +]) + diff --git a/m4/ax_boost_serialization.m4 b/m4/ax_boost_serialization.m4 new file mode 100644 index 000000000..21fd40b05 --- /dev/null +++ b/m4/ax_boost_serialization.m4 @@ -0,0 +1,119 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_boost_serialization.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_SERIALIZATION +# +# DESCRIPTION +# +# Test for Serialization library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. Further documentation is +# available at . +# +# This macro calls: +# +# AC_SUBST(BOOST_SERIALIZATION_LIB) +# +# And sets: +# +# HAVE_BOOST_SERIALIZATION +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 24 + +AC_DEFUN([AX_BOOST_SERIALIZATION], +[ + AC_ARG_WITH([boost-serialization], + AS_HELP_STRING([--with-boost-serialization@<:@=special-lib@:>@], + [use the Serialization library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-serialization=boost_serialization-gcc-mt-d-1_33_1 ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_serialization_lib="" + else + want_boost="yes" + ax_boost_user_serialization_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + AC_MSG_WARN(BOOST_CPPFLAGS $BOOST_CPPFLAGS) + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::Serialization library is available, + ax_cv_boost_serialization, + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include + @%:@include + @%:@include + ]], + [[std::ofstream ofs("filename"); + boost::archive::text_oarchive oa(ofs); + return 0; + ]])], + ax_cv_boost_serialization=yes, ax_cv_boost_serialization=no) + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_serialization" = "xyes"; then + AC_DEFINE(HAVE_BOOST_SERIALIZATION,,[define if the Boost::Serialization library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + ax_lib= + if test "x$ax_boost_user_serialization_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_serialization*.so* $BOOSTLIBDIR/libboost_serialization*.dylib* $BOOSTLIBDIR/libboost_serialization*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_serialization.*\)\.so.*$;\1;' -e 's;^lib\(boost_serialization.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_serialization.*\)\.a*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break], + [link_serialization="no"]) + done + if test "x$link_serialization" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_serialization*.dll* $BOOSTLIBDIR/boost_serialization*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_serialization.*\)\.dll.*$;\1;' -e 's;^\(boost_serialization.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break], + [link_serialization="no"]) + done + fi + + else + for ax_lib in $ax_boost_user_serialization_lib boost_serialization-$ax_boost_user_serialization_lib; do + AC_CHECK_LIB($ax_lib, main, + [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break], + [link_serialization="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the Boost::Serialization library!) + fi + if test "x$link_serialization" != "xyes"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) + diff --git a/rtlib/generic_opts.hh b/rtlib/generic_opts.hh index 732fbbbb5..3fdf0ecce 100644 --- a/rtlib/generic_opts.hh +++ b/rtlib/generic_opts.hh @@ -27,8 +27,11 @@ extern "C" { #include #include + #include + #include } +#include #include #include #include @@ -39,9 +42,11 @@ extern "C" { #include #include -// define _XOPEN_SOURCE=500 +#ifdef CHECKPOINTING_INTEGRATED +#include "boost/filesystem.hpp" +#endif -#include +// define _XOPEN_SOURCE=500 namespace gapc { @@ -63,6 +68,38 @@ class Opts { Opts(const Opts&); Opts &operator=(const Opts&); + int parse_checkpointing_interval(const std::string &interval) { + // parse the user-specified checkpointing interval + std::stringstream tmp_interval(interval); + std::string val; + std::vector interval_vals; + + try { + // parse the checkpointing interval the user specified + while (std::getline(tmp_interval, val, ':')) { + // split the interval string at ':' and store values + interval_vals.push_back(std::stoi(val)); + } + + if (interval_vals.size() != 4) { + throw std::exception(); + } + } catch (const std::exception &e) { + throw OptException("Invalid interval format! " + "Must be d:h:m:s (e.g. 0:0:1:0)."); + } + + // calculate the interval length (in seconds) + int cp_interval = interval_vals[0] * 86400 + interval_vals[1] * 3600 + + interval_vals[2] * 60 + interval_vals[3]; + + if (cp_interval <= 0) { + throw OptException("Interval cannot be <= 0 (is " + + std::to_string(cp_interval) + ")."); + } + return cp_interval; + } + public: typedef std::vector > inputs_t; inputs_t inputs; @@ -74,6 +111,16 @@ class Opts { unsigned int repeats; unsigned k; +#ifdef CHECKPOINTING_INTEGRATED + size_t checkpoint_interval; // default interval: 3600s (1h) + boost::filesystem::path checkpoint_out_path; // default path: cwd + boost::filesystem::path checkpoint_in_path; // default: empty + std::string user_file_prefix; + bool keep_archives; // default: delete after calculations completed +#endif + int argc; + char **argv; + Opts() : #ifdef WINDOW_MODE @@ -85,8 +132,16 @@ class Opts { window_increment(0), delta(0), repeats(1), - k(3) { - } + k(3), +#ifdef CHECKPOINTING_INTEGRATED + checkpoint_interval(DEFAULT_CHECKPOINT_INTERVAL), + checkpoint_out_path(boost::filesystem::current_path()), + checkpoint_in_path(boost::filesystem::path("")), + user_file_prefix(""), + keep_archives(false), +#endif + argc(0), + argv(0) {} ~Opts() { for (inputs_t::iterator i = inputs.begin(); i != inputs.end(); ++i) @@ -101,7 +156,49 @@ class Opts { #ifdef LIBRNA_RNALIB_H_ << " (-[tT] [0-9]+)? (-P PARAM-file)?" #endif - << " (-[drk] [0-9]+)* (INPUT|-f INPUT-file)\n\n" + << " (-[drk] [0-9]+)* (-h)? (INPUT|-f INPUT-file)\n" + << "--help ,-h print this help message\n" +#ifdef CHECKPOINTING_INTEGRATED + << "--checkpointInterval,-p d:h:m:s specify the periodic " + << "checkpointing\n" + << " interval,default: 0:1:0:0 " + << "(1h)\n" + << "--checkpointOutput,-O PATH/PREFIX set path where to store " + << "the checkpoints,\n" + << " default: current working " + << "directory\n" + << " Optional: add custom prefix " + << "for generated\n" + << " files to PATH (e.g. PATH:\n" + << " \"/path/to/dir/file_prefix\"" + << "\n" + << " will set PATH to \"/path/to/" + << "dir/\"\n" + << " and PREFIX to \"file_prefix\"" + << ").\n" + << " Make sure to add a \"/\" to\n" + << " the end of PATH if you don't" + << "\n" + << " wish to add a custom prefix " + << "to the files.\n" + << "--checkpointInput,-I LOGFILE set the path to the Logfile\n" + << " of the checkpoints you wish " + << "to load.\n" + << " (This file was generated " + << "along\n" + << " with the checkpoint archives." + << "\n" + << " If it isn't available\n" + << " add the path to each archive " + << "to a \n" + << " text file and provide the \n" + << " path to this file).\n" + << "--keepArchives,-K don't delete checkpointing " + << "archives\n" + << " after the program finished " + << "its calculations\n" +#endif + << "\n" #if defined(GAPC_CALL_STRING) && defined(GAPC_VERSION_STRING) << "GAPC call: \"" << GAPC_CALL_STRING << "\"\n" << "GAPC version: \"" << GAPC_VERSION_STRING << "\"\n" @@ -112,17 +209,30 @@ class Opts { void parse(int argc, char **argv) { int o = 0; char *input = 0; + const option long_opts[] = { + {"help", no_argument, nullptr, 'h'}, + {"checkpointInterval", required_argument, nullptr, 'p'}, + {"checkpointOutput", required_argument, nullptr, 'O'}, + {"checkpointInput", required_argument, nullptr, 'I'}, + {"keepArchives", no_argument, nullptr, 'K'}, + {nullptr, no_argument, nullptr, 0}}; + this->argc = argc; + this->argv = argv; + #ifdef LIBRNA_RNALIB_H_ char *par_filename = 0; #endif - while ((o = getopt(argc, argv, ":f:" + while ((o = getopt_long(argc, argv, ":f:" #ifdef WINDOW_MODE "w:i:" #endif #ifdef LIBRNA_RNALIB_H_ "t:T:P:" #endif - "hd:r:k:")) != -1) { +#ifdef CHECKPOINTING_INTEGRATED + "p:I:KO:" +#endif + "hd:r:k:H:", long_opts, nullptr)) != -1) { switch (o) { case 'f' : { @@ -183,6 +293,69 @@ class Opts { case 'r' : repeats = std::atoi(optarg); break; +#ifdef CHECKPOINTING_INTEGRATED + case 'p' : + checkpoint_interval = parse_checkpointing_interval(optarg); + break; + case 'I' : + { + boost::filesystem::path arg_path(optarg); + if (arg_path.is_absolute()) { + checkpoint_in_path = arg_path; + } else { + checkpoint_in_path = boost::filesystem::current_path() / arg_path; + } + if (!boost::filesystem::exists(checkpoint_in_path) || + !boost::filesystem::is_regular_file(checkpoint_in_path)) { + throw OptException("Logfile could not be found at path \"" + + checkpoint_in_path.string() + + "\"!"); + } + + // check if current user has read permissions + // for checkpoint input directory + if (access(checkpoint_in_path.c_str(), R_OK) != 0) { + throw OptException("Missing read permissions for" + " Logfile \"" + + checkpoint_in_path.string() + + "\"!"); + } + break; + } + case 'O' : + { + boost::filesystem::path arg_path(optarg); + boost::filesystem::path out_path = arg_path.parent_path(); + + if (out_path.is_absolute()) { + checkpoint_out_path = out_path; + } else { + checkpoint_out_path /= out_path; + } + + user_file_prefix = arg_path.filename().string(); + + if (!boost::filesystem::exists(checkpoint_out_path) || + !boost::filesystem::is_directory(checkpoint_out_path)) { + throw OptException("The output path \"" + + checkpoint_out_path.string() + + "\" is not a directory!"); + } + + // check if current user has write permissions + // for checkpoint output directory + if (access(checkpoint_out_path.c_str(), W_OK) != 0) { + throw OptException("Missing write permissions for" + " output path \"" + + checkpoint_out_path.string() + + "\"!"); + } + break; + } + case 'K' : + keep_archives = true; + break; +#endif case '?' : case ':' : { diff --git a/rtlib/hashtng.hh b/rtlib/hashtng.hh index 57024cc92..6cd4072df 100644 --- a/rtlib/hashtng.hh +++ b/rtlib/hashtng.hh @@ -45,6 +45,13 @@ #include "hash_stats.hh" +#if defined(CHECKPOINTING_INTEGRATED) +// serialization headers for the checkpointing of Hash_Ref objects +// (will be included in generated code through rtlib/adp.hh) + +#include "boost/serialization/base_object.hpp" // serialize base obj of class +#endif + using std::swap; @@ -115,6 +122,21 @@ struct DisableShrink { template struct Default_Inspector { +#if defined(CHECKPOINTING_INTEGRATED) + /* + while this default inspector doesn't contain any members, + custom inspector objects are often used as template arguments + for the Set class that gets wrapped in the Hash::Ref class; + these custom inspectors can potentially contain members + that need to be serialized, so this default + inspector needs an empty serialize method so boost doesn't complain + */ + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + } +#endif T init(const T &x) const { return x; } U hash(const T &x) const { return hashable_value(x); @@ -154,6 +176,17 @@ template class Set { private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + ar & array; + ar & init; + ar & used_; + ar & inspector; + } +#endif Vector_Sparse array; std::vector init; U used_; @@ -228,6 +261,11 @@ class Set { Set &operator=(const Set&); public: +#ifdef CHECKPOINTING_INTEGRATED + size_t vector_size() const { + return array.size(); + } +#endif U ref_count; Set() : used_(0), @@ -375,6 +413,18 @@ void Set::operator delete(void *b) noexcept(false) { template class Ref : public ::Ref::Lazy > { private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + // serialize the base object + // (basically just a wrapper around boost::shared_ptr) + ar & + boost::serialization::base_object<::Ref::Lazy>>(*this); + } +#endif + public: }; diff --git a/rtlib/list.hh b/rtlib/list.hh index a074d2372..3a3407931 100644 --- a/rtlib/list.hh +++ b/rtlib/list.hh @@ -53,6 +53,14 @@ #include "output.hh" #include "hash.hh" +#if defined(CHECKPOINTING_INTEGRATED) +// serialization headers for the checkpointing of ListRef objects +// (will be included in generated code through rtlib/adp.hh) + +#include "boost/serialization/base_object.hpp" // serialize base obj of class +#include "boost/serialization/deque.hpp" // serialize std::deque +#endif + // FIXME // #include @@ -66,6 +74,17 @@ template class List : public std::deque { public: typedef typename std::deque::reverse_iterator reverse_iterator; + + private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + // serialize the base object (std::deque) + ar & boost::serialization::base_object>(*this); + } +#endif }; @@ -86,6 +105,19 @@ template class List_Ref : public ::Ref::Lazy > { public: typedef typename List::reverse_iterator reverse_iterator; + + private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + // serialize the base object + // (basically just a wrapper around boost::shared_ptr) + ar & + boost::serialization::base_object<::Ref::Lazy>>(*this); + } +#endif }; template @@ -135,7 +167,6 @@ inline void append(List_Ref &x, List_Ref &e) { if (isEmpty(e)) return; assert(&x.ref() != &e.ref()); - std::copy(e.ref().begin(), e.ref().end(), std::back_inserter(x.ref())); } diff --git a/rtlib/ref.hh b/rtlib/ref.hh index 6ab35ea6f..d60f7dbf7 100644 --- a/rtlib/ref.hh +++ b/rtlib/ref.hh @@ -27,11 +27,25 @@ #include #include +#if defined(CHECKPOINTING_INTEGRATED) +#include "boost/serialization/shared_ptr.hpp" // serialize boost::shared_ptr +#endif + namespace Ref { template class Lazy { public: boost::shared_ptr l; + private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + ar & l; + } +#endif + protected: void lazy() { if (!l.use_count()) l.reset(new T()); diff --git a/rtlib/rope.hh b/rtlib/rope.hh index 953f87acc..1e13ff4c7 100644 --- a/rtlib/rope.hh +++ b/rtlib/rope.hh @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include @@ -77,6 +79,17 @@ class Block { private: // enum { RL , LR } Dir; // Dir dir; +#ifdef CHECKPOINTING_INTEGRATED + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int version) { + ar & pos; + ar & next; + for (unsigned char i = 0; i < pos; i++) { + ar & array[i]; + } + } +#endif Block &operator=(const Block &r); Block(const Block &r); @@ -171,6 +184,13 @@ template class Readonly { template<> class Readonly { private: +#ifdef CHECKPOINTING_INTEGRATED + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int version) { + ar & pos; + } +#endif unsigned char pos; public: @@ -219,6 +239,16 @@ class Ref { static Pool > pool; private: +#ifdef CHECKPOINTING_INTEGRATED + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int version) { + ar & first; + ar & last; + ar & empty_; + ar & readonly; + } +#endif Block *first; Block *last; bool empty_; @@ -405,8 +435,62 @@ class Ref { append(s); } - template - void put(O &o) const { + /* + need to overload put methods, because operator<< needs to be + overloaded so it doesn't interfere with boost's operator<< + overload for the serialization of an archive + */ + void put(std::ofstream &o) const { + if (readonly == true) { + Block* i = first; + while (i) { + unsigned char z = 0; + if (i == last) { + z = readonly(); + } else { + z = i->size(); + assert(z == Block::block_size); + } + for (unsigned char j = 0; j < z; ++j) + o << i->array[j]; + i = i->next; + } + } else { + Block* i = first; + while (i) { + for (unsigned char j = 0; j < i->size(); ++j) + o << i->array[j]; + i = i->next; + } + } + } + + void put(std::stringstream &o) const { + if (readonly == true) { + Block* i = first; + while (i) { + unsigned char z = 0; + if (i == last) { + z = readonly(); + } else { + z = i->size(); + assert(z == Block::block_size); + } + for (unsigned char j = 0; j < z; ++j) + o << i->array[j]; + i = i->next; + } + } else { + Block* i = first; + while (i) { + for (unsigned char j = 0; j < i->size(); ++j) + o << i->array[j]; + i = i->next; + } + } + } + + void put(std::ostream &o) const { if (readonly == true) { Block* i = first; while (i) { @@ -622,8 +706,26 @@ class Ref { } }; -template - inline O &operator<<(O &o, const Ref& r) { r.put(o); return o; } +template +inline std::ofstream &operator<<(std::ofstream &o, + const Ref& r) { + r.put(o); + return o; +} + +template +inline std::stringstream &operator<<(std::stringstream &o, + const Ref& r) { + r.put(o); + return o; +} + +template +inline std::ostream &operator<<(std::ostream &o, + const Ref& r) { + r.put(o); + return o; +} } // namespace rope diff --git a/rtlib/shape.hh b/rtlib/shape.hh index 84b251d20..ab89e32a2 100644 --- a/rtlib/shape.hh +++ b/rtlib/shape.hh @@ -41,6 +41,9 @@ #include "bitops.hh" #include "multipool.hh" +#ifdef CHECKPOINTING_INTEGRATED +#include "boost/serialization/split_member.hpp" +#endif #ifndef HAVE_EFFICIENT_FFS #ifdef __GNUC__ @@ -51,6 +54,38 @@ template > class Fiber { private: +#ifdef CHECKPOINTING_INTEGRATED + friend class boost::serialization::access; + + template + void save(Archive & ar, const unsigned int version) const { + if (is_null_elem()) { + ar << (Size)0; + } else { + ar << length(); + for (Size i = 0; i < length(); i++) { + ar << array[i]; + } + } + } + + template + void load(Archive & ar, const unsigned int version) { + Size array_size; + ar >> array_size; + if (array_size == 0) { + array = &null_elem; + } else { + array = alloc(array_size); // need to allocate space first + for (Size i = 0; i < array_size; i++) { + ar >> array[i]; + } + } + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +#endif + enum { bits = sizeof(T)*8, char_width = alphset::char_width, chars = bits/char_width }; @@ -88,8 +123,7 @@ class Fiber { public: T *array; - Fiber() : array(&null_elem) { - } + Fiber() : array(&null_elem) {} Fiber(const Fiber &other) { if (other.isEmpty()) { diff --git a/rtlib/string.hh b/rtlib/string.hh index a58c4f5ae..de835f689 100644 --- a/rtlib/string.hh +++ b/rtlib/string.hh @@ -31,6 +31,8 @@ #include #include #include +#include +#include // tr1 has it #include @@ -44,8 +46,32 @@ class String { private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + ar & block; + ar & readonly; + ar & empty_; + ar & block_as_int; + } +#endif + + public: class Block { private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) { + ar & pos; + for (unsigned char i = 0; i < pos; i++) { + ar & array[i]; + } + } +#endif void del(Block *b) { assert(b->ref_count); b->dec_ref(); @@ -56,8 +82,10 @@ class String { Block &operator=(const Block &b); public: - uint32_t ref_count; - // enum { size = 27 }; + uint32_t ref_count; + + // total size of object should be 64 bytes + // (refcount: 4 bytes, pos: 1 byte, array: 59 bytes -> 64 bytes total) enum { size = 59 }; enum { SEQ_END, SEQ, LINK, REP }; @@ -132,11 +160,9 @@ class String { iterator begin() { return iterator(this); } iterator end() { return iterator(this, this); } - Block() : ref_count(1), pos(0) { - } + Block() : ref_count(1), pos(0) {} - Block(const Block &b) - : ref_count(1), pos(b.pos) { + Block(const Block &b) : ref_count(1), pos(b.pos) { for (unsigned char i = 0; i < pos; ++i) array[i] = b.array[i]; for (iterator i = begin(); i != end(); ++i) @@ -183,8 +209,9 @@ class String { b->inc_ref(); assert(pos + 1 + sizeof(Block*) <= size); array[pos++] = LINK; - for (unsigned char i = 0; i < sizeof(Block*); ++i) + for (unsigned char i = 0; i < sizeof(Block*); ++i) { array[pos++] = ((unsigned char*)&b)[i]; + } } void append(char c, uint32_t l) { @@ -205,6 +232,7 @@ class String { void put(std::ostream &s) const; }; + private: static Pool pool; Block *block; @@ -212,13 +240,17 @@ class String { bool empty_; void del() { - if (!block) + if (!block) { return; + } assert(block->ref_count); block->dec_ref(); if (!block->ref_count) { delete block; block = NULL; +#if defined(CHECKPOINTING_INTEGRATED) + block_as_int = 0; +#endif } } @@ -227,16 +259,35 @@ class String { Block *t = new Block(*block); del(); block = t; +#if defined(CHECKPOINTING_INTEGRATED) + block_as_int = reinterpret_cast(block); +#endif } } public: - String() : block(NULL), readonly(false), empty_(false) { +#if defined(CHECKPOINTING_INTEGRATED) + // store block ptr as decimal number so + // links can be restored after deserialization + uintptr_t block_as_int; +#endif + + String() : block(NULL), readonly(false), empty_(false) +#if defined(CHECKPOINTING_INTEGRATED) + , block_as_int(0) +#endif + {} + + Block *get_block() const { + return block; } void lazy_alloc() { if (!block) block = new Block(); +#if defined(CHECKPOINTING_INTEGRATED) + block_as_int = reinterpret_cast(block); +#endif } String(const String &s) { @@ -248,6 +299,9 @@ class String { readonly = false; } empty_ = s.empty_; +#if defined(CHECKPOINTING_INTEGRATED) + block_as_int = reinterpret_cast(block); +#endif } ~String() { @@ -442,6 +496,9 @@ class String { else readonly = false; empty_ = s.empty_; +#if defined(CHECKPOINTING_INTEGRATED) + block_as_int = reinterpret_cast(block); +#endif return *this; } diff --git a/rtlib/subsequence.hh b/rtlib/subsequence.hh index d9f3b8a9b..8a73a6d1b 100644 --- a/rtlib/subsequence.hh +++ b/rtlib/subsequence.hh @@ -30,6 +30,20 @@ template class Basic_Subsequence { +#ifdef CHECKPOINTING_INTEGRATED + + private: + friend class boost::serialization::access; + + template + void serialize(Archive &ar, const unsigned int version) { + // only serialize i and j since *seq is the same + // for evey Basic_Subsequence object (*seq will be set afterwards) + ar & i; + ar & j; + } +#endif + public: const Basic_Sequence *seq; pos_type i; diff --git a/rtlib/vector_sparse.hh b/rtlib/vector_sparse.hh index 39f9891e8..b968358c4 100644 --- a/rtlib/vector_sparse.hh +++ b/rtlib/vector_sparse.hh @@ -31,11 +31,43 @@ #include +#if defined(CHECKPOINTING_INTEGRATED) +#include "boost/serialization/split_member.hpp" +#endif + using std::swap; template class Stapel { private: +#if defined(CHECKPOINTING_INTEGRATED) + friend class boost::serialization::access; + + template + void save(Archive &ar, const unsigned int version) const { + ar << size_; + ar << top_; + for (size_t i = 0; i < size_; i++) { + ar << array[i]; + } + } + + template + void load(Archive &ar, const unsigned int version) { + // temporarily store size_ value in tmp_size, + // because resize method won't execute if its input + // is <= size_, so it wouldn't do anything if size_ is set directly + U tmp_size; + ar >> tmp_size; + resize(tmp_size); // this will set size_ + ar >> top_; + for (size_t i = 0; i < size_; i++) { + ar >> array[i]; + } + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +#endif T *array; U top_, size_; @@ -43,8 +75,7 @@ class Stapel { Stapel &operator=(const Stapel &); public: - Stapel() : array(0), top_(0), size_(0) { - } + Stapel() : array(0), top_(0), size_(0) {} explicit Stapel(U i) : array(0), top_(0), size_(0) { resize(i); @@ -121,6 +152,37 @@ swap(Stapel &a, Stapel &b) { template class Vector_Sparse { private: +#if defined(CHECKPOINTING_INTEGRATED) + size_t n_elements; + friend class boost::serialization::access; + + template + void save(Archive &ar, const unsigned int version) const { + ar << stack; + ar << size_; + for (size_t i = 0; i < size_; i++) { + ar << array[i]; + } + } + + template + void load(Archive &ar, const unsigned int version) { + ar >> stack; + + // temporarily store size_ value in tmp_size, + // because resize method won't execute if its input + // is <= size_, so it wouldn't do anything if size_ is set directly + U tmp_size; + ar >> tmp_size; + resize(tmp_size); // allocate space for array and set size_ + + for (size_t i = 0; i < size_; i++) { + ar >> array[i]; + } + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +#endif T *array; U size_; Stapel stack; @@ -131,8 +193,7 @@ template class Vector_Sparse { Vector_Sparse &operator=(const Vector_Sparse &); public: - Vector_Sparse() : array(0), size_(0) { - } + Vector_Sparse() : array(0), size_(0) {} explicit Vector_Sparse(U i) : array(0), size_(0) { resize(i); diff --git a/src/ast.cc b/src/ast.cc index 5e7bdad4e..c53598ce4 100644 --- a/src/ast.cc +++ b/src/ast.cc @@ -63,7 +63,8 @@ AST::AST() backtrack_product(0), backtrack_filter(0), original_product(0), - char_type(0) { + char_type(0), + checkpoint(nullptr) { Type::add_predefined(types); } diff --git a/src/ast.hh b/src/ast.hh index 05b759797..c070c6d32 100644 --- a/src/ast.hh +++ b/src/ast.hh @@ -57,6 +57,8 @@ #include "printer_fwd.hh" #include "product.hh" +#include "checkpoint.hh" + class Signature; class Instance; @@ -294,6 +296,8 @@ class AST { Product::Base * get_backtrack_product() { return backtrack_product; } + + Printer::Checkpoint *checkpoint; }; #endif // SRC_AST_HH_ diff --git a/src/checkpoint.hh b/src/checkpoint.hh new file mode 100644 index 000000000..aeac68c0c --- /dev/null +++ b/src/checkpoint.hh @@ -0,0 +1,1351 @@ +/* {{{ + + This file is part of gapc (GAPC - Grammars, Algebras, Products - Compiler; + a system to compile algebraic dynamic programming programs) + + Copyright (C) 2008-2011 Georg Sauthoff + email: gsauthof@techfak.uni-bielefeld.de or gsauthof@sdf.lonestar.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + * Author: fymue +}}} */ + +#ifndef SRC_CHECKPOINT_HH_ +#define SRC_CHECKPOINT_HH_ + +#include +#include +#include +#include +#include +#include "printer.hh" +#include "symbol.hh" +#include "statement/table_decl.hh" +#include "type/base.hh" + +// default checkpointing interval +// (modify here if you want to change it) +#define DEFAULT_CP_INTERVAL_SEC 3600 +#define DEFAULT_CP_INTERVAL_MIN (DEFAULT_CP_INTERVAL_SEC / 60) + +typedef hashtable nt_tables; + +namespace Printer { +/* + contains methods that handle the insertion of the checkpointing + routine into the generated header file; + this class also extends Base to get access to indent-related methods +*/ +class Checkpoint : public Base { + private: + /* + true if table types are wrapped in List_Ref; + this information is required whenever the String type + is part of a table's datatype, because tables containting + Strings need to be additionally processed after deserialization, + which can only work if the Strings are wrapped in a List_Ref object + */ + bool list_ref; + + std::vector string_type_accessors, block_type_accessors, + subseq_type_accessors; + + // currently supported/serializable GAPC-internal datatypes (2023-02-20) + const std::vector + SUPPORTED_TYPES = {Type::Type::VOID, Type::Type::INTEGER, + Type::Type::INT, Type::Type::FLOAT, + Type::Type::SIZE, Type::Type::SINGLE, + Type::Type::BIGINT, Type::Type::STRING, + Type::Type::SHAPE, Type::Type::SUBSEQ, + Type::Type::EXTERNAL, Type::Type::CHAR}; + +/* + currently supported/(de)serializable external datatyes (2023-02-20); + except for Rope (which is part of rtlib), all of these types + are defined in the fold-grammars repository; + unfortunately programs that tabulate external types + with "String" or "Subsequence" members cannot be checkpointed, + because no member information can be generated for external + types since C++ doesn't support reflection, + which makes accessor generation and thus checkpointing + those types impossible; + if you want to checkpoint a program that tabulates non- + supported external types (that also don't contain "String" + or "Subsequence" objects), make sure to provide a "serialize" + method for them (cf. e.g. rope.hh, line 242 or + https://www.boost.org/doc/libs/1_80_0/libs/serialization/doc/tutorial.html); +*/ +const std::vector +SUPPORTED_EXTERNAL_TYPES = {"Rope", "answer_pknot_mfe", "pktype", + "answer_pknot_mfecovar", "mfecovar", + "pftuple", "answer_pknot_pfunc", + "shape_t"}; + + // check if the currently looked at type is contained + // in SUPPORTED_TYPES or SUPPORTED_EXTERNAL_TYPES + bool has_type(const std::vector &supported_types, + const std::vector &supported_ext_types, + Type::Type type, Type::Base *t) { + for (Type::Type supported_type : supported_types) { + if (type == supported_type) { + if (type == Type::Type::STRING) { + strings = true; + } else if (type == Type::Type::SUBSEQ) { + subseq = true; + } else if (type == Type::Type::EXTERNAL) { + // only allow external type "Rope" and some fold-grammars types + Type::External *e = dynamic_cast(t); + bool supported_external_type = false; + for (const std::string &supported_ext : supported_ext_types) { + if (*e->name == supported_ext) { + supported_external_type = true; + break; + } + } + if (!supported_external_type) { + std::cerr << "Error: External type \"" << *e->name + << "\" cannot be serialized by default.\n" + << "Please provide a serialize method for this type.\n"; + return false; + } + } + return true; + } + } + std::cerr << "Error: Type \"" << *t << "\" cannot be serialized.\n"; + return false; + } + + /* + add the final accessor to the currently looked at type + if the current type is "String", the it's block needs to be + accessed (str.get_block()) as well as the address of that block + as an integer (str.block_as_int); + if the current type is "Subsequence", it's "seq" member needs + to be accessed (subseq.seq) + */ + void add_type_accessor(Type::Type type, + std::vector &type_accessor) { + if (type == Type::Type::STRING) { + std::stringstream final_type_accessor; + for (auto el : type_accessor) final_type_accessor << el; + string_type_accessors.push_back(final_type_accessor.str() + + ".block_as_int"); + block_type_accessors.push_back(final_type_accessor.str() + + ".get_block()"); + } else if (type == Type::Type::SUBSEQ) { + std::stringstream final_type_accessor; + for (auto el : type_accessor) final_type_accessor << el; + subseq_type_accessors.push_back(final_type_accessor.str() + + ".seq"); + } + } + + bool __is_supported(Type::Base *type) { + Type::Type curr_type = type->getType(); + + if (curr_type == Type::Type::LIST) { + // List_Ref or Hash::Ref + list_ref = true; + return __is_supported(type->component()); + } else if (curr_type == Type::Type::TUPLE) { + // algebra product + // check if type has left and right (e.g. std::pair) + bool has_left_and_right = + type->component()->getType() == Type::Type::TUPLE; + if (has_left_and_right) { + return __is_supported(type->left()) && __is_supported(type->right()); + } else { + return __is_supported(type->component()); + } + } else if (curr_type == Type::Type::TUPLEDEF || + curr_type == Type::Type::DEF) { + // user-defined type + // (gets converted to struct; all members need to be supported) + Type::TupleDef *s = NULL; + if (curr_type == Type::Type::DEF) { + Type::Def *d = dynamic_cast(type); + + // sometimes DEF is really just TUPLEDEF in disguise, so check for that + if (d->rhs->getType() == Type::Type::TUPLEDEF) { + s = dynamic_cast(d->rhs); + } else { + return __is_supported(d->rhs); + } + } else { + s = dynamic_cast(type); + } + + // check if every member of struct/user-defined type is supported + for (std::list*>::const_iterator + i = s->list.begin(); i != s->list.end(); ++i) { + Type::Base *curr_type = (*i)->first->lhs->simple(); + if (!__is_supported(curr_type)) return false; + } + user_def = true; + return true; + } else if (curr_type == Type::Type::USAGE) { + Type::Usage *u = dynamic_cast(type); + return __is_supported(u->base); + } + + return has_type(SUPPORTED_TYPES, SUPPORTED_EXTERNAL_TYPES, + curr_type, type); + } + + /* + generate accessors for types so they can be indexed/addressed + (required for String, Subsequence and user-defined types); + these accessors will be inserted into the generated code + as marcos, which will be expanded in the respective target + functions (restore_string_links for "String" and + "add_seq_to_subseqs" for "Subsequence" and used to access + these objects efficiently without the need to do any searching + where exactly these objects are stored + */ + void gen_type_accessors(Type::Base *type, + std::vector &type_accessor) { + Type::Type curr_type = type->getType(); + + if (curr_type == Type::Type::LIST) { + gen_type_accessors(type->component(), type_accessor); + return; + } else if (curr_type == Type::Type::TUPLE) { + // check if type has left and right (e.g. std::pair) + bool has_left_and_right = + type->component()->getType() == Type::Type::TUPLE; + if (has_left_and_right) { + type_accessor.push_back(".first"); + + gen_type_accessors(type->left(), type_accessor); + type_accessor.pop_back(); + + type_accessor.push_back(".second"); + gen_type_accessors(type->right(), type_accessor); + type_accessor.pop_back(); + + return; + } else { + gen_type_accessors(type->component(), type_accessor); + return; + } + } else if (curr_type == Type::Type::TUPLEDEF || + curr_type == Type::Type::DEF) { + // user-defined type + Type::TupleDef *s = NULL; + if (curr_type == Type::Type::DEF) { + Type::Def *d = dynamic_cast(type); + + // sometimes DEF is really just TUPLEDEF in disguise, so check for that + if (d->rhs->getType() == Type::Type::TUPLEDEF) { + s = dynamic_cast(d->rhs); + } else { + return gen_type_accessors(d->rhs, type_accessor); + } + } else { + s = dynamic_cast(type); + } + + for (std::list*>::const_iterator + i = s->list.begin(); i != s->list.end(); ++i) { + Type::Base *member_type = (*i)->first->lhs->simple(); + const std::string &member_name = *(*i)->second; // name of member var + + type_accessor.push_back("." + member_name); + gen_type_accessors(member_type, type_accessor); + type_accessor.pop_back(); + } + + return; + } + + add_type_accessor(curr_type, type_accessor); + } + + public: + /* + true if tables contain String objects; + these are a lot more complicated to deserialize than other types as + they require the manual restoration of the links between Strings + so this boolean information is needed when generating the + source code so additional code can be inserted to enable + the proper deserialization of these types + */ + bool strings; + + /* + true if tables contain Subsequence objects (require additional processing); + this will most likely only be needed if a Subsequence object + is part of a user-specified type which is tabulated as e.g. + a pretty-print algebra + */ + bool subseq; + + /* + true if tables contain a user-defined type; + this type is represented as a struct in the generated header file; + if the checkpointing option was specified, this struct needs + a serialize method so the tables containing this type can be + (de)serialized properly + */ + bool user_def; + + /* + true if the currently parsed out class is a buddy class, + in which case the checkpointing routine doesn't need to + be integrated + */ + bool is_buddy; + + Checkpoint() : list_ref(false), strings(false), + subseq(false), user_def(false), + is_buddy(false) {} + + bool is_supported(const nt_tables &tables) { + // check datatypes of every table (all tables must have supported type) + bool supported = true; + Type::Base *table_type = nullptr; + + for (auto table : tables) { + table_type = table.second->data_type(); + if (!__is_supported(table_type)) { + supported = false; + break; + } + } + + if (supported && (strings || subseq || user_def)) { + /* + generate accessors for String/Subsequence/user-defined types; + these are needed to access these objects efficiently during + (de)serialization of the checkpointed archives; + for Strings: only works if String objects are wrapped in a List_Ref + object, so return false if List_Ref is not part of the type + */ + if (strings && !list_ref) { + supported = false; + } else { + std::vector type_accessor; + gen_type_accessors(table_type, type_accessor); + } + } + + return supported; + } + + void macros(Printer::Base &stream) { + stream << "#define DEFAULT_CHECKPOINT_INTERVAL " + << DEFAULT_CP_INTERVAL_SEC << endl << endl; + if (list_ref) { + // set macro if tables contain List_Ref type + stream << "#define LIST_REF" << endl << endl; + } + if (strings) { + // define macros for easy/efficient access to String/Block objects + for (size_t i = 0; i < string_type_accessors.size(); i++) { + if (!(string_type_accessors[i].empty())) { + stream << "#define S" << i+1 << " " + << string_type_accessors[i] + .substr(1, string_type_accessors[i].npos)<< endl; + stream << "#define B" << i+1 << " " + << block_type_accessors[i] + .substr(1, block_type_accessors[i].npos)<< endl; + } + } + stream << endl; + } + if (subseq) { + // define macros for easy/efficient access to Subsequence objects + for (size_t i = 0; i < subseq_type_accessors.size(); i++) { + if (!(subseq_type_accessors[i].empty())) { + stream << "#define SUBSEQ" << i+1 << " " + << subseq_type_accessors[i] + .substr(1, subseq_type_accessors[i].npos)<< endl; + } + } + stream << endl; + } + } + + void include(Printer::Base &stream, const nt_tables &tables) { + stream << "extern \"C\" {" << endl; + stream << indent() << "#include " << endl; + stream << indent() << "#include " << endl; + stream << "}" << endl; + stream << "#include \"boost/serialization/vector.hpp\"" << endl; + stream << "#include \"boost/serialization/utility.hpp\"" << endl; + stream << "#include \"boost/serialization/access.hpp\"" << endl; + stream << "#include \"boost/archive/binary_iarchive.hpp\"" << endl; + stream << "#include \"boost/archive/binary_oarchive.hpp\"" << endl; + stream << "#include \"boost/filesystem.hpp\"" << endl; + stream << "#include " << endl; + stream << "#include " << endl; + stream << "#include " << endl; + stream << "#include " << endl; + stream << "#include " << endl << endl; + } + + /* + this method restores the links between the String objects of the + different tables; + internally, String objects can only store 59 characters/bytes of data. + In order to allow for longer strings, String objects are linked together + similarly to a linked list; + the links however are directly written into the data buffer of a String + object and not stored as a ptr member of the object, which renders the + links useless after deserialization since the memory addresses that were + written into the data buffers of the strings are now no longer valid; + to restore these links, this function loops over every string and looks at + an additional new String member ("block_as_int"), which contains the address + of the links as an integer value; + these can be used to perform lookups whenever a link is parsed, at which + point the broken address can be overwritten and the actual address + of the linked string can be written into the data buffer, which restores + the links between the strings + */ + void restore_string_links(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void restore_string_links() {" << endl; + inc_indent(); + size_t n_tables = tables.size(); + stream << indent() << "int n_tables = " << n_tables << ";" << endl; + stream << indent() << "size_t max_table_size = 0;" << endl; + stream << indent() << "std::unordered_map " + << "link_map;" << endl; + stream << indent() << "std::unordered_map<" << endl + << indent() << " uintptr_t, std::vector>> " + << "block_linked_at;" << endl; + stream << indent() << "std::vector> " + << "broken_listrefs, initial_broken_listrefs;" << endl; + size_t c = 0; + for (auto i = tables.begin(); i != tables.end(); ++i) { + c++; + const std::string &table_name = i->second->table_decl->name(); + if (c == 1) { + stream << indent() << "std::vector<" + << i->second->table_decl->datatype() + << ">" << endl; + stream << indent() << "*tables[] = {" + << table_name << ".get_table()," << endl; + } else { + stream << indent() << " "; + if (c < n_tables) { + stream << table_name << ".get_table()," << endl; + } else { + stream << table_name << ".get_table()};" << endl << endl; + } + } + } + c = 0; + for (auto i = tables.begin(); i != tables.end(); ++i) { + c++; + const std::string &table_name = i->second->table_decl->name(); + if (c == 1) { + stream << indent() << "std::vector *tabulated[] = {" + << table_name << ".get_tabulated()," << endl; + } else { + stream << indent() << " "; + if (c < n_tables) { + stream << table_name << ".get_tabulated()," << endl; + } else { + stream << table_name << ".get_tabulated()};" << endl << endl; + } + } + } + c = 0; + for (auto i = tables.begin(); i != tables.end(); ++i) { + c++; + const std::string &table_name = i->second->table_decl->name(); + if (c == 1) { + stream << indent() << "size_t *tabulated_counts[] = {" + << table_name << ".get_tabulated_count()," << endl; + } else { + stream << indent() << " "; + if (c < n_tables) { + stream << table_name << ".get_tabulated_count()," << endl; + } else { + stream << table_name << ".get_tabulated_count()};" << endl << endl; + } + } + } + stream << indent() << "// create link map" << endl; + stream << indent() << "for (int i = 0; i < n_tables; i++) {" << endl; + inc_indent(); + stream << indent() << "auto &curr_table = *(tables[i]);" << endl; + stream << indent() << "max_table_size = " + << "max(max_table_size, curr_table.size());" << endl; + stream << indent() << "for (size_t j = 0; " + << "j < curr_table.size(); j++) {" << endl; + inc_indent(); + stream << indent() << "auto &l = curr_table[j].ref();" << endl; + stream << indent() << "for (size_t k = 0; k < l.size(); k++) {" << endl; + inc_indent(); + for (size_t i = 0; i < string_type_accessors.size(); i++) { + stream << indent() << "if (l[k].S" << i+1 << ") {" << endl; + inc_indent(); + stream << indent() << "// add address of block of current string to map" + << endl; + stream << indent() << "assert(l[k].S" << i+1 + << " && l[k].B" << i+1 << ");" << endl; + stream << indent() << "String::Block *b = l[k].B" << i+1 << ";" << endl; + stream << indent() << "link_map[l[k].S" << i+1 << "] = b;" + << endl << endl; + stream << indent() << "unsigned char c = 0;" << endl; + stream << indent() << "// store table/vector idx of every linked Block" + << endl; + stream << indent() << "// so invalid links can be removed properly" + << endl; + stream << indent() << "while (c < b->pos) {" << endl; + inc_indent(); + stream << indent() << "switch (b->array[c]) {" << endl; + inc_indent(); + stream << indent() << "case String::Block::REP :" << endl; + inc_indent(); + stream << indent() << "c += 6;" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "case String::Block::SEQ :" << endl; + inc_indent(); + stream << indent() << "c += 3;" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "case String::Block::LINK :" << endl; + stream << indent() << "{" << endl; + inc_indent(); + stream << indent() << "c++;" << endl; + stream << indent() << "uintptr_t linked_block = " + << "reinterpret_cast(b->get_link(c));" << endl; + stream << indent() << "if (block_linked_at.find(linked_block) !=" + << " block_linked_at.end()) {" << endl; + inc_indent(); + stream << indent() << "block_linked_at[linked_block]." + << "emplace_back(i, j);" << endl; + dec_indent(); + stream << indent() << "} else {" << endl; + inc_indent(); + stream << indent() << "block_linked_at[linked_block] = " + << "std::vector>{" << endl + << " " + << "std::pair{i, j}};" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "c += 8;" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "default :" << endl; + inc_indent(); + stream << indent() << "c++;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + } + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "// restore string links" << endl; + + stream << indent() << "for (int i = 0; i < n_tables; i++) {" << endl; + inc_indent(); + stream << indent() << "auto &curr_table = *(tables[i]);" << endl; + stream << indent() << "for (size_t j = 0; j < curr_table.size(); j++) {" + << endl; + inc_indent(); + stream << indent() << "auto &l = curr_table[j].ref();" << endl; + stream << indent() << "if (!((*(tabulated[i]))[j])) {" << endl; + inc_indent(); + stream << indent() << "assert(l.size() == 0);" << endl; + stream << indent() << "continue;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "// true if an unresolvable link was found in " + << "one of the Strings of the current ListRef" << endl; + stream << indent() << "bool cant_resolve = false;" << endl; + stream << indent() << "std::vector valid_links;" << endl; + stream << indent() << "for (size_t k = 0; k < l.size() " + << "&& !cant_resolve; k++) {" << endl; + inc_indent(); + for (size_t i = 0; i < string_type_accessors.size(); i++) { + stream << indent() << "if (l[k].B" << i+1 << ") {" << endl; + inc_indent(); + stream << indent() << "assert(l[k].S" << i+1 + << " && l[k].B" << i+1 << ");" << endl; + stream << indent() << "String::Block *b = l[k].B" << i+1 << ";" << endl; + stream << indent() << "unsigned char c = 0;" << endl; + stream << indent() << "// replace addresses of all links with " + << "new addresses of respective blocks after deserialization" + << endl; + stream << indent() << "while (c < b->pos && !cant_resolve) {" << endl; + inc_indent(); + stream << indent() << "switch (b->array[c]) {" << endl; + inc_indent(); + stream << indent() << "case String::Block::REP :" << endl; + inc_indent(); + stream << indent() << "c += 6;" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "case String::Block::SEQ :" << endl; + inc_indent(); + stream << indent() << "c += 3;" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "case String::Block::LINK :" << endl; + stream << indent() << "{" << endl; + inc_indent(); + stream << indent() << "c++;" << endl; + stream << indent() << "uintptr_t linked_block = " + << "reinterpret_cast(b->get_link(c));" << endl; + stream << indent() << "if (link_map.find(linked_block) == " + << "link_map.end()) {" << endl; + inc_indent(); + /* + check if link can be mapped to an existing Block in one of the tables; + if not, this link can't be resolved and the String object + wrapping this Block as well as all the other String objects + in the current ListRef have to be deleted so they are recalculated + once the algorithm requests this ListRef; + to ensure that every other String/ListRef can resolve its links, + we have to make sure that the to-be-deleted Strings aren't + linked anywhere else; + if they are, we also have to delete the Strings where these + Strings are linked; + we have to keep doing this until all Strings that need to be deleted + aren't linked to any other strings + */ + stream << indent() << "cant_resolve = true;" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "String::Block *next_block = " + << "link_map[linked_block];" << endl; + stream << indent() << "assert(next_block);" << endl; + stream << indent() << "// overwrite memory address of linked block" + << "with memory address of the same block after deserialization" + << endl; + stream << indent() << "assert(c + sizeof(String::Block*) <= b->pos);" + << endl; + stream << indent() << "for (unsigned char t = 0; t < " + << "sizeof(String::Block*); t++, c++) {" + << endl; + inc_indent(); + stream << indent() << "b->array[c] = ((unsigned char*)&next_block)[t];" + << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "valid_links.push_back(next_block);" << endl; + stream << indent() << "break;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "default :" << endl; + inc_indent(); + stream << indent() << "c++;" << endl; + dec_indent(); dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + } + stream << indent() << "}" << endl; + stream << indent() << "if (cant_resolve) {" << endl; + inc_indent(); + stream << indent() << "// mark current ListRef for delete/overwrite" + << endl; + stream << indent() << "initial_broken_listrefs.emplace_back(i, j);" + << endl; + dec_indent(); + stream << indent() << "} else {" << endl; + inc_indent(); + stream << indent() << "for (String::Block *b : valid_links) b->inc_ref();" + << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + // only recursively call from the initial elements of broken_listrefs + stream << indent() << "std::vector already_checked" + << "(n_tables * max_table_size);" << endl; + stream << indent() << "for (auto &ilr : initial_broken_listrefs) {" + << endl; + inc_indent(); + stream << indent() << "std::vector> " + << "additional{ilr};" << endl; + stream << indent() << "size_t idx = ilr.first * " + << "max_table_size + ilr.second;" << endl; + stream << indent() << "already_checked[idx] = true;" << endl; + stream << indent() << "find_broken_listrefs(additional, tables, " + << "block_linked_at, max_table_size, already_checked);" << endl; + stream << indent() << "for (auto &lr : additional) {" << endl; + inc_indent(); + stream << indent() << "broken_listrefs.emplace_back(lr);" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "// mark the broken ListRefs " + << "as not tabulated" << endl; + stream << indent() << "for (const auto& b : " + << "broken_listrefs) {" << endl; + inc_indent(); + stream << indent() << "int table_i = b.first;" << endl; + stream << indent() << "size_t vec_i = b.second;" << endl; + stream << indent() << "bool is_tabulated = " + << "(*(tabulated[table_i]))[vec_i];" << endl; + stream << indent() << "if (is_tabulated) {" << endl; + inc_indent(); + stream << indent() << "(*(tabulated[table_i]))[vec_i] = false;" << endl; + stream << indent() << "(*(tabulated_counts[table_i]))--;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void find_broken_listrefs(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void find_broken_listrefs(" + << "std::vector> &broken_listrefs," << endl + << indent() << "std::vector<" + << tables.begin()->second->table_decl->datatype() + << "> *tables[]," << endl + << indent() << "std::unordered_map>> &block_linked_at," << endl + << indent() << "size_t max_table_size, " + << "std::vector &already_checked) {" + << endl; + inc_indent(); + stream << indent() << "// recursively add all ListRefs that " + << "need to invalidated" << endl; + stream << indent() << "// because they contain links to Strings that " + << "also need" << endl; + stream << indent() << "// to be invalidated to the broken_listrefs vector" + << endl << endl; + stream << indent() << "if (broken_listrefs.empty()) return;" << endl; + stream << indent() << "bool has_link = false;" << endl; + stream << indent() << "std::pair &b = " + << "broken_listrefs.back();" << endl; + stream << indent() << "int table_i = b.first;" << endl; + stream << indent() << "size_t vec_i = b.second;" << endl; + stream << indent() << "auto &listref = (*(tables[table_i]))[vec_i].ref();" + << endl; + stream << indent() << "for (size_t i = 0; i < " + << "listref.size(); i++) {" << endl; + inc_indent(); + stream << indent() << "if (listref[i].B1) {" << endl; + inc_indent(); + stream << indent() << "assert(listref[i].S1 && listref[i].B1);" << endl; + stream << indent() << "uintptr_t b_int = listref[i].S1;" << endl; + stream << indent() << "String::Block *b = listref[i].B1;" << endl; + stream << indent() << "b->inc_ref();" << endl; + stream << indent() << "if (block_linked_at[b_int].size() > 0) {" << endl; + inc_indent(); + stream << indent() << "// if a String that is linked to " + << "somewhere is found;" << endl; + stream << indent() << "// the Strings that link to this " + << "String need to be deleted as well" << endl; + stream << indent() << "has_link = true;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "// recursion anchor" << endl; + stream << indent() << "// (will only be executed if a String of the " + << "current ListRef is linked to somewhere)" << endl; + stream << indent() << "if (has_link) {" << endl; + inc_indent(); + stream << indent() << "for (size_t i = 0; i < listref.size(); i++) {" + << endl; + inc_indent(); + stream << indent() << "if (listref[i].B1) {" << endl; + inc_indent(); + stream << indent() << "std::vector> &links = " + << "block_linked_at[listref[i].S1];" << endl; + stream << indent() << "for (auto& nxt_listref : links) {" << endl; + inc_indent(); + stream << indent() << "size_t idx = nxt_listref.first * " + << "max_table_size + nxt_listref.second;" << endl; + stream << indent() << "if (!(already_checked[idx])) {" << endl; + inc_indent(); + stream << indent() << "already_checked[idx] = true;" << endl; + stream << indent() << "broken_listrefs.push_back(nxt_listref);" << endl; + stream << indent() << "find_broken_listrefs(broken_listrefs, " + << "tables, block_linked_at, max_table_size, already_checked);" + << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void add_seq_to_subseqs(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void add_seq_to_subseqs() {" << endl; + inc_indent(); + stream << indent() << "// add seq ptr to all Subsequence objects" << endl; + stream << indent() << "// (seq wasn't serialized for efficiency " + << "since it's the same for every Subsequence object)" << endl; + size_t c = 0; + size_t n_tables = tables.size(); + stream << indent() << "int n_tables = " << n_tables << ";" << endl; + for (auto i = tables.begin(); i != tables.end(); ++i) { + c++; + const std::string &table_name = i->second->table_decl->name(); + if (c == 1) { + stream << indent() << "std::vector<" + << i->second->table_decl->datatype() + << ">" << endl; + stream << indent() << "*tables[] = {" + << table_name << ".get_table()," << endl; + } else { + stream << indent() << " "; + if (c < n_tables) { + stream << table_name << ".get_table()," << endl; + } else { + stream << table_name << ".get_table()};" << endl << endl; + } + } + } + stream << indent() << "for (int i = 0; i < n_tables; i++) {" << endl; + inc_indent(); + stream << indent() << "auto &curr_table = *(tables[i]);" << endl; + stream << indent() << "for (size_t j = 0; " + << "j < curr_table.size(); j++) {" << endl; + inc_indent(); + if (list_ref) { + stream << indent() << "auto &l = curr_table[j].ref();" << endl; + stream << indent() << "for (size_t k = 0; k < l.size(); k++) {" << endl; + inc_indent(); + for (size_t s = 0; s < subseq_type_accessors.size(); s++) { + stream << indent() << "l[k].SUBSEQ" << s+1 << " = &t_0_seq;" << endl; + } + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + } else { + for (size_t s = 0; s < subseq_type_accessors.size(); s++) { + stream << indent() << "curr_table[j].SUBSEQ" + << s+1 << " = &t_0_seq;" << endl; + } + } + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void archive(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent(); + stream << "void archive(const std::string &tname) {" << endl; + inc_indent(); + stream << indent() << "// save the DP table/array to disk" << endl; + stream << indent() << "try {" << endl; + inc_indent(); + stream << indent() << "/* create temp archive and replace last archive " + << "with new archive" << endl + << indent() << " once new archive has been created instead " + << "of just overwriting" << endl + << indent() << " the last archive to avoid file corruption " + << "if process crashes during overwrite */" << endl; + stream << indent() << "std::ofstream array_fout(tmp_out_table_path.c_str()" + << ", std::ios::binary);" << endl; + stream << indent() << "if (!(array_fout.good())) {" << endl; + stream << indent() << " throw std::ofstream::failure(\"\");" << endl; + stream << indent() << "}" << endl; + stream << indent() << "boost::archive::binary_oarchive " + "array_out(array_fout);" << endl; + stream << indent() << "// lock the mutex so main thread can't " + << "write during archiving" << endl; + stream << indent() << "std::lock_guard lock(m);" << endl; + stream << indent() << "array_out << array << tabulated << " + << "tabulated_vals_counter;" << endl; + stream << indent() << "array_fout.close();" << endl; + stream << indent() << "boost::filesystem::rename(tmp_out_table_path, " + << "out_table_path);" << endl; + stream << indent() << "std::cerr << \"Info: Archived \\\"\" << tname << " + << "\"\\\" table into \" << out_table_path" << endl + << indent() << " << \". Table is \" " + << "<< get_tabulated_vals_percentage() << \"% filled.\" " + << "<< std::endl;" << endl; + dec_indent(); + stream << indent() << "} catch (const std::ofstream::failure &e) {" + << endl; + stream << indent() << " std::cerr << \"Couldn't create table archive " + << "at path \" << out_table_path << \".\\n\"" << endl; + stream << indent() << " << \"Please ensure that the directory " + << "exists and that you have write permissions " + << "for this directory.\\n\";" << endl; + stream << indent() << "} catch (const std::exception &e) {" << endl; + inc_indent(); + stream << indent() << "std::time_t curr_time = std::time(nullptr);" + << endl; + stream << indent() << "char curr_time_str[" + << "sizeof(\"yyyy-mm-dd, hh:mm:ss\")];" << endl; + stream << indent() << "std::strftime(curr_time_str, sizeof(curr_time_str)," + << " \"%F, %T\", std::localtime(&curr_time));" << endl; + stream << indent() << "std::cerr << \"[\" << curr_time_str << \"] " + << "Error trying to archive \\\"\" << tname << \"\\\" table.\"" + << endl; + stream << indent() << " << \" Will retry in \" " + << "<< formatted_interval << \".\\n\";" << endl; + stream << indent() << "boost::filesystem::remove(tmp_out_table_path);" + << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void remove(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent(); + stream << "void remove() {" << endl; + inc_indent(); + stream << indent() << "boost::filesystem::remove(out_table_path);" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void get_table(Printer::Base &stream, const Type::Base &dtype) { + inc_indent(); inc_indent(); + stream << indent(); + stream << "std::vector<" << dtype << "> *get_table() {" << endl; + inc_indent(); + stream << indent() << "return &array;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void get_tabulated(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent(); + stream << "std::vector *get_tabulated() {" << endl; + inc_indent(); + stream << indent() << "return &tabulated;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void get_tabulated_count(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent(); + stream << "size_t *get_tabulated_count() {" << endl; + inc_indent(); + stream << indent() << "return &tabulated_vals_counter;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void get_out_table_path(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent() << "std::string get_out_table_path() const {" << endl; + inc_indent(); + stream << indent() << "return out_table_path.string();" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void get_tabulated_vals_percentage(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent(); + stream << "double get_tabulated_vals_percentage() const {" << endl; + inc_indent(); + stream << indent() << "return static_cast(tabulated_vals_counter) " + << "/ tabulated.size() * 100.0;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } + + void init(Printer::Base &stream) { + inc_indent(); inc_indent(); inc_indent(); + stream << indent() << "this->formatted_interval = formatted_interval;" + << endl; + stream << indent() << "out_table_path = out_path / (file_prefix + \"_\" + " + << "tname);" << endl; + stream << indent() << "tmp_out_table_path = out_path / (file_prefix + " + << "\"_\" + tname + \"_new\");" << endl << endl; + stream << indent() << "if (!(in_path.empty())) {" << endl; + inc_indent(); + stream << indent() << "// read the DP array/table from disk " + "and put its contents into array" << endl; + stream << indent() << "try {" << endl; + inc_indent(); + stream << indent() << "parse_checkpoint_log(tname, arg_string, in_path);" + << endl << endl; + stream << indent() << "std::ifstream array_fin(in_table_path.c_str(), " + << "std::ios::binary);" << endl; + stream << indent() << "if (!(array_fin.good())) {" << endl; + stream << indent() << " throw std::ifstream::failure(\"\");" << endl; + stream << indent() << "}" << endl; + stream << indent() << "boost::archive::binary_iarchive " + "array_in(array_fin);" << endl; + stream << indent() << "array_in >> array >> tabulated >> " + << "tabulated_vals_counter;" << endl; + stream << indent() << "array_fin.close();" << endl << endl; + stream << indent() << "std::cerr << \"Info: Successfully loaded checkpoint" + << " for \\\"\" << tname << \"\\\" table. \"" << endl; + stream << indent() << " << \"Will continue calculating from here." + << "\" << std::endl;" << endl; + dec_indent(); + stream << indent() << "} catch (const ParseException &e) {" + << endl; + inc_indent(); + stream << indent() << "std::cerr << e.what() << std::endl;" << endl; + stream << indent() << "std::exit(1);" << endl; + dec_indent(); + stream << indent() << "} catch (const std::ifstream::failure &e) {" + << endl; + inc_indent(); + stream << indent() << "std::cerr << \"Error: \\\"\" + tname + \"\\\" " + << "archive\"" << endl; + stream << indent() << " << " << "\" could not be found in " + << "Logfile or hasn't been archived yet.\\n\";" << endl; + stream << indent() << "std::exit(1);" << endl; + dec_indent(); + stream << indent() << "} catch (const std::exception &e) {" << endl; + inc_indent(); + stream << indent() << "std::cerr << \"Error \\\"\" << e.what() << \"\\\" " + "trying to read \\\"\" << tname << " + "\"\\\" table!\\n\";" << endl; + stream << indent() << "std::exit(1);" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "} else {" << endl; + inc_indent(); + stream << indent() << "array.resize(newsize);" << endl; + stream << indent() << "tabulated.clear();" << endl; + stream << indent() << "tabulated.resize(newsize);" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); dec_indent(); + } + + void archive_periodically(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void archive_periodically(std::atomic_bool " + "&cancel_token, size_t interval) {" << endl; + inc_indent(); + stream << indent() << "// save all tables to the disk periodically " + "every interval seconds" << endl; + stream << indent() << "cancel_token.store(true);" << endl; + stream << indent() << "std::thread([=, &cancel_token]() mutable {" + << endl; + stream << indent() << " while (cancel_token.load()) {" + << endl; + stream << indent() << " std::this_thread::sleep_for(" + "std::chrono::seconds(interval));" << endl; + stream << indent() << " " + "if (!cancel_token.load()) break;" << endl; + + for (auto i = tables.begin(); i != tables.end(); ++i) { + const std::string &table_name = i->second->table_decl->name(); + stream << " " << indent(); + stream << table_name << ".archive(\"" << table_name << "\");" << endl; + } + stream << " " << indent(); + stream << "update_checkpoint_log();" << endl; + stream << " }" << endl; + stream << " }).detach();" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void remove_tables(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void remove_tables() {" << endl; + inc_indent(); + for (auto i = tables.begin(); i != tables.end(); ++i) { + const std::string &table_name = i->second->table_decl->name(); + stream << indent() << table_name << ".remove();" << endl; + } + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void remove_log_file(Printer::Base &stream) { + inc_indent(); + stream << indent() << "void remove_log_file() {" << endl; + inc_indent(); + stream << indent() << "// remove the log file after " + << "successful termination of the program" << endl; + stream << indent() << "boost::filesystem::remove(logfile_path);" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void format_interval(Printer::Base &stream) { + inc_indent(); + stream << indent() << "std::string format_interval(int interval) {" + << endl; + inc_indent(); + stream << indent() << "// format the user-provided checkpointing " + << "interval (for logging)" << endl; + stream << indent() << "int days = interval / 86400;" << endl; + stream << indent() << "int hours = (interval % 86400) / 3600;" << endl; + stream << indent() << "int minutes = ((interval % 86400) % 3600) / 60;" + << endl; + stream << indent() << "int seconds = ((interval % 86400) % 3600) % 60;" + << endl; + stream << indent() << "return std::to_string(days) + \" days, \" +" + << endl; + stream << indent() << " std::to_string(hours) + \" hours, \" +" + << endl; + stream << indent() << " std::to_string(minutes) + \" minutes " + << "and \" + std::to_string(seconds) + \" seconds\";" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void get_arg_string(Printer::Base &stream) { + inc_indent(); + stream << indent() << "std::string get_arg_str(int argc, char **argv) {" + << endl; + inc_indent(); + stream << indent() << "// create a string from all relevant command " + << "line arguments" << endl; + stream << indent() << "std::stringstream arg_string;" << endl; + stream << indent() << "std::vector ordered_args;" << endl; + stream << indent() << "int i = 1;" << endl; + stream << indent() << "while (i < argc) {" << endl; + inc_indent(); + stream << indent() << "if (std::strcmp(argv[i], \"-p\")" + << " == 0 ||" << endl; + stream << indent() << " std::strcmp(argv[i], \"-I\")" + << " == 0 ||" << endl; + stream << indent() << " std::strcmp(argv[i], \"-O\")" + << " == 0 ||" << endl; + stream << indent() << " std::strcmp(argv[i], \"--checkpointOutput\")" + << " == 0 ||" << endl; + stream << indent() << " std::strcmp(argv[i], \"--checkpointInput\")" + << " == 0 ||" << endl; + stream << indent() << " std::strcmp(argv[i], \"--checkpointInterval\")" + << " == 0) {" << endl; + inc_indent(); + stream << indent() << "i += 2;" << endl; + dec_indent(); + stream << indent() << "} else if (std::strcmp(argv[i], \"--keepArchives\")" + << " == 0 ||" << endl; + stream << indent() << " std::strcmp(argv[i], \"-K\") == 0) {" + << endl; + inc_indent(); + stream << indent() << "++i;" << endl; + dec_indent(); + stream << indent() << "} else {" << endl; + inc_indent(); + stream << indent() << "std::stringstream arg_pair;" << endl; + stream << indent() << "arg_pair << argv[i++] << \" \";" << endl; + stream << indent() << "if (i < argc) arg_pair << argv[i++];" << endl; + stream << indent() << "ordered_args.push_back(arg_pair.str());" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "std::sort(ordered_args.begin(), " + << "ordered_args.end());" << endl; + stream << indent() << "for (std::string &el : ordered_args) {" << endl; + inc_indent(); + stream << indent() << "arg_string << el << \" \";" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "return arg_string.str();" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void create_checkpoint_log(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void create_checkpoint_log(" + << "const gapc::Opts &opts, const std::string &arg_string) {" + << endl; + inc_indent(); + stream << indent() << "// initialize a Log file to keep track " + << "of archive paths" << endl; + stream << indent() << "std::ofstream fout(logfile_path.c_str(), " + << "std::ios::out);" << endl; + stream << indent() << "fout << \"# Format:\\n# [OPTIONS] argv[1] " + << "argv[2] ...\\n\";" << endl; + for (auto i = tables.begin(); i != tables.end(); ++i) { + const std::string &table_name = i->second->table_decl->name(); + stream << indent() << "fout << \"# [TABLE_NAME] path/to/" + << table_name << "\\n\";" << endl; + } + stream << indent() << "fout << \"# [GAPC CALL] GAPC call string\\n\";" + << endl; + stream << indent() << "fout << \"# [GAPC VERSION] GAPC version\\n\";" + << endl; + stream << indent() << "fout << \"# [CHECKPOINT] cpu_time(s) max_rss(kb) "; + for (auto i = tables.begin(); i != tables.end(); ++i) { + const std::string &table_name = i->second->table_decl->name(); + stream << table_name << "(%) "; + } + stream << "\\n\";" << endl; + stream << indent() << "fout << \"[OPTIONS] \" << arg_string << \"\\n\";" + << endl; + for (auto i = tables.begin(); i != tables.end(); ++i) { + const std::string &table_name = i->second->table_decl->name(); + stream << indent() << "fout << \"[" << table_name << "] \" << " + << table_name << ".get_out_table_path() " + << "<< \"\\n\";" << endl; + } + stream << indent() << "fout << \"[GAPC CALL] \" << GAPC_CALL_STRING " + << "<< \"\\n\";" << endl; + stream << indent() << "fout << \"[GAPC VERSION] \" << GAPC_VERSION_STRING " + << "<< \"\\n\";" << endl; + stream << indent() << "fout.close();" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void update_checkpoint_log(Printer::Base &stream, const nt_tables &tables) { + inc_indent(); + stream << indent() << "void update_checkpoint_log() {" << endl; + inc_indent(); + stream << indent() << "// add cpu time and max rss from start of " + << "program to the current checkpoint" << endl; + stream << indent() << "std::ofstream fout(logfile_path.c_str(), " + << "std::ios::out | std::ios::app);" << endl; + stream << indent() << "struct rusage curr_usage;" << endl; + stream << indent() << "int success = getrusage(RUSAGE_SELF, &curr_usage);" + << endl; + stream << indent() << "if (success == 0) {" << endl; + inc_indent(); + stream << indent() << "long max_rss = curr_usage.ru_maxrss;" << endl; + stream << indent() << "std::clock_t curr_cpu_time = std::clock();" << endl; + stream << indent() << "double cpu_time_since_start = 1000.0 * " + << "(curr_cpu_time - start_cpu_time) / CLOCKS_PER_SEC;" << endl; + stream << indent() << "fout << \"[CHECKPOINT] \"" + << " << std::to_string(cpu_time_since_start / 1000.0) << \" \"" + << " << std::to_string(max_rss) << \" \";" << endl; + for (auto i = tables.begin(); i != tables.end(); ++i) { + const std::string &table_name = i->second->table_decl->name(); + stream << indent() << "fout << " << table_name + << ".get_tabulated_vals_percentage() << \" \";" << endl; + } + stream << endl << indent() << "fout << \"\\n\";" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "fout.close();" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); + } + + void parse_checkpoint_log(Printer::Base &stream) { + inc_indent(); inc_indent(); + stream << indent() << "void parse_checkpoint_log(" + << "const std::string &tname, const std::string &arg_string," + << endl + << indent() << " " + << "const boost::filesystem::path &path) {" + << endl; + inc_indent(); + stream << indent() << "// parse the checkpoint log and look " + << "for checkpoints" << endl; + stream << indent() << "// that were created with identical program " + << "input (if that info is available)" << endl; + stream << indent() << "std::ifstream fin(path.c_str());" << endl; + stream << indent() << "if (!(fin.good())) return;" + << endl << endl; + stream << indent() << "std::string line, curr_tname;" << endl; + stream << indent() << "std::string options_line_start = \"[OPTIONS] \";" + << endl; + stream << indent() << "std::string table_path_start = " + << "\"[\" + tname + \"] \";" << endl; + stream << indent() << "while (std::getline(fin, line)) {" << endl; + inc_indent(); + stream << indent() << "if (line[0] == '#') continue;" << endl; + stream << indent() << "size_t i = line.find(options_line_start);" << endl; + stream << indent() << "if (i != line.npos) {" << endl; + inc_indent(); + stream << indent() << "line.replace(i, options_line_start.length(), " + << "\"\");" << endl; + stream << indent() << "if (line != arg_string) {" << endl; + inc_indent(); + stream << indent() << "throw ParseException(\"Error: The checkpoint " + << "for \\\"\" + tname + \"\\\" table was created with different \"" + << endl + << indent() << " \"command line inputs than" + << " this program was executed with.\\n\");" << endl; + stream << indent() << "return;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "i = line.find(table_path_start);" << endl; + stream << indent() << "if (i != line.npos) {" << endl; + inc_indent(); + stream << indent() << "curr_tname = line.substr(1, line.find(\"]\") - 1);" + << endl; + stream << indent() << "if (curr_tname == tname) {" + << endl; + inc_indent(); + stream << indent() << "line.replace(i, table_path_start.length(), " + << "\"\");" << endl; + stream << indent() << "in_table_path = boost::filesystem::path(line);" + << endl; + stream << indent() << "return;" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + dec_indent(); dec_indent(); + } +}; +} // namespace Printer + +#endif // SRC_CHECKPOINT_HH_ diff --git a/src/cpp.cc b/src/cpp.cc index f4b5df89a..ae9ce0661 100644 --- a/src/cpp.cc +++ b/src/cpp.cc @@ -1060,6 +1060,7 @@ void Printer::Cpp::print_window_inc(const Symbol::NT &nt) { void Printer::Cpp::print(const Statement::Table_Decl &t) { in_class = true; bool wmode = ast && ast->window_mode; + bool checkpoint = ast && ast->checkpoint && !ast->checkpoint->is_buddy; std::string tname(t.name() + "_t"); const Type::Base &dtype = t.datatype(); @@ -1088,6 +1089,16 @@ void Printer::Cpp::print(const Statement::Table_Decl &t) { print(ns); stream << indent() << dtype << " zero;" << endl; + if (checkpoint) { + stream << indent() << "boost::filesystem::path out_table_path;" << endl; + stream << indent() << "boost::filesystem::path tmp_out_table_path;" << endl; + stream << indent() << "boost::filesystem::path in_table_path;" << endl; + stream << indent() << "std::mutex m;" << endl; + stream << indent() << "std::string formatted_interval;" << endl; + stream << indent() << "size_t tabulated_vals_counter = 0;" << endl; + stream << endl; + } + stream << t.fn_size() << endl; dec_indent(); @@ -1100,6 +1111,21 @@ void Printer::Cpp::print(const Statement::Table_Decl &t) { dec_indent(); stream << indent() << "}" << endl << endl; + if (checkpoint) { + ast->checkpoint->archive(stream); + ast->checkpoint->remove(stream); + ast->checkpoint->get_out_table_path(stream); + ast->checkpoint->get_tabulated_vals_percentage(stream); + ast->checkpoint->parse_checkpoint_log(stream); + if (ast->checkpoint->strings || ast->checkpoint->subseq) { + ast->checkpoint->get_table(stream, dtype); + } + if (ast->checkpoint->strings) { + ast->checkpoint->get_tabulated(stream); + ast->checkpoint->get_tabulated_count(stream); + } + } + // start "void init()" stream << indent() << "void init("; print_paras(ns, '_'); @@ -1109,6 +1135,13 @@ void Printer::Cpp::print(const Statement::Table_Decl &t) { } stream << ", const std::string &tname"; + if (checkpoint) { + stream << ", const boost::filesystem::path &out_path," << endl + << indent() << " const boost::filesystem::path &in_path, " + << "const std::string &arg_string," << endl + << indent() << " const std::string &formatted_interval, " + << "const std::string &file_prefix"; + } stream << ") {" << endl; inc_indent(); print_eqs(ns, '_'); @@ -1128,11 +1161,18 @@ void Printer::Cpp::print(const Statement::Table_Decl &t) { stream << indent() << ptype << " newsize = size("; stream << ");" << endl; - stream << indent() << "array.resize(newsize);" << endl; - if (!cyk) { + + if (!cyk && !checkpoint) { stream << indent() << "tabulated.clear();" << endl; stream << indent() << "tabulated.resize(newsize);" << endl; } + + if (checkpoint) { + ast->checkpoint->init(stream); + } else { + stream << indent() << "array.resize(newsize);" << endl; + } + dec_indent(); stream << indent() << "}" << endl << endl; // end "void init()" @@ -1316,67 +1356,101 @@ void Printer::Cpp::print_type_defs(const AST &ast) { } stream << indent() << "bool empty_;" << endl << indent() << *def->name << "() : empty_(false) {}" << endl; - dec_indent(); + + if (ast.checkpoint && ast.checkpoint->user_def && + !ast.checkpoint->is_buddy) { + // serialize method for user-defined type + stream << indent() << "friend class boost::serialization::access;" + << endl << endl; + stream << indent() << "template " << endl; + stream << indent() << "void serialize(Archive &ar, " + << "const unsigned int version) {" << endl; + inc_indent(); + for (std::list*>::const_iterator + i = tuple->list.begin(); i != tuple->list.end(); ++i) { + stream << indent() << "ar & " << *(*i)->second << ";" << endl; + } + stream << indent() << "ar & empty_;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + } // FIXME let user decide how to compare user defined tuples ... if (tuple->list.front()->first->lhs->const_simple()->is(Type::INT) || tuple->list.front()->first->lhs->const_simple()->is(Type::FLOAT) || tuple->list.front()->first->lhs->const_simple()->is(Type::SINGLE)) { - stream << "bool operator>(const " << *def->name << "& other) const {" - << " return " << *tuple->list.front()->second << " > " - << "other." << *tuple->list.front()->second << "; }" << endl; - stream << "bool operator<(const " << *def->name << "& other) const {" - << " return " << *tuple->list.front()->second << " < " - << "other." << *tuple->list.front()->second << "; }" << endl; - stream << "bool operator==(const " << *def->name - << "& other) const {" - << " return " << *tuple->list.front()->second << " == " - << "other." << *tuple->list.front()->second << "; }" << endl; - stream << "template bool operator>(const T &other) " - << "const {" - << "return " << *tuple->list.front()->second << " > other; }" - << endl; - stream << "template bool operator<(const T &other) " - << "const {" - << "return " << *tuple->list.front()->second << " < other; }" - << endl; - stream << "template bool operator==(const T &other) " + stream << indent() + << "bool operator>(const " << *def->name << "& other) const {" + << " return " << *tuple->list.front()->second << " > " + << "other." << *tuple->list.front()->second << "; }" << endl; + stream << indent() + << "bool operator<(const " << *def->name << "& other) const {" + << " return " << *tuple->list.front()->second << " < " + << "other." << *tuple->list.front()->second << "; }" << endl; + stream << indent() + << "bool operator==(const " << *def->name + << "& other) const {" + << " return " << *tuple->list.front()->second << " == " + << "other." << *tuple->list.front()->second << "; }" << endl; + stream << indent() + << "template bool operator>(const T &other) " + << "const {" + << "return " << *tuple->list.front()->second << " > other; }" + << endl; + stream << indent() + << "template bool operator<(const T &other) " + << "const {" + << "return " << *tuple->list.front()->second << " < other; }" + << endl; + stream << indent() + << "template bool operator==(const T &other) " << "const {" << "return " << *tuple->list.front()->second << " == other; }" << endl; // Subopt bt operators - stream << endl << endl; - stream << *def->name << "(int i) : " << *tuple->list.front()->second - << "(i), empty_(false) {}" << endl; - stream << *def->name << " operator+(const " << *def->name - << " &other) const" << endl << '{' << endl - << "assert(!empty_); assert(!other.empty_);" << endl - << "return " << *def->name << '(' << *tuple->list.front()->second - << " + other." << *tuple->list.front()->second << ");" << endl - << '}' << endl; - stream << *def->name << " operator-(const " << *def->name - << " &other) const" << endl << '{' << endl - << "assert(!empty_);" << endl - << "if (other.empty_) return " << *def->name << '(' - << *tuple->list.front()->second << ");" << endl - << "return " << *def->name << '(' << *tuple->list.front()->second - << " - other." << *tuple->list.front()->second << ");" << endl - << '}' << endl; - stream << "bool operator<=(const " << *def->name - << "& other) const {" - << endl - << "assert(!empty_); assert(!other.empty_);" << endl - << "return " << *tuple->list.front()->second << " <= " - << "other." << *tuple->list.front()->second << ";" - << endl << "}" << endl; + stream << indent() << endl << endl; + stream << indent() << *def->name << "(int i) : " + << *tuple->list.front()->second + << "(i), empty_(false) {}" << endl; + stream << indent() << *def->name << " operator+(const " << *def->name + << " &other) const" << '{' << endl; + inc_indent(); + stream << indent() << "assert(!empty_); assert(!other.empty_);" + << endl; + stream << indent() << "return " << *def->name << '(' + << *tuple->list.front()->second + << " + other." << *tuple->list.front()->second << ");" << endl; + dec_indent(); + stream << indent() << '}' << endl; + stream << indent() << *def->name << " operator-(const " << *def->name + << " &other) const" << '{' << endl; + inc_indent(); + stream << indent() << "assert(!empty_);" << endl; + stream << indent() << "if (other.empty_) return " << *def->name << '(' + << *tuple->list.front()->second << ");" << endl; + stream << indent() << "return " << *def->name << '(' + << *tuple->list.front()->second + << " - other." << *tuple->list.front()->second << ");" << endl; + dec_indent(); + stream << indent() << '}' << endl; + stream << indent() << "bool operator<=(const " << *def->name + << "& other) const {" << endl; + inc_indent(); + stream << indent() << "assert(!empty_); assert(!other.empty_);" + << endl; + stream << indent() << "return " << *tuple->list.front()->second + << " <= " << "other." << *tuple->list.front()->second << ";" + << endl; + dec_indent(); + stream << indent() << "}" << endl; } - - stream << endl << indent() << "};" << endl << endl; + dec_indent(); + stream << indent() << "};" << endl << endl; stream << indent() - << "inline std::ostream &operator<<(std::ostream &o, const " - << *def->name << " &tuple) {" << endl; + << "inline std::ostream &operator<<(std::ostream &o, const " + << *def->name << " &tuple) {" << endl; inc_indent(); stream << indent() << "o << '('"; assert(!tuple->list.empty()); @@ -1388,7 +1462,7 @@ void Printer::Cpp::print_type_defs(const AST &ast) { stream << indent() << " << \", \" << tuple." << *(*j)->second << endl; } - stream << indent() << " << ')' ;" << endl; + stream << indent() << " << ')' ;" << endl; stream << indent() << "return o;" << endl; dec_indent(); stream << indent() << '}' << endl << endl; @@ -1443,6 +1517,43 @@ void Printer::Cpp::print_seq_init(const AST &ast) { << indent() << indent() << "throw gapc::OptException(\"Number of input " << "sequences does not match.\");\n\n"; + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + stream << indent() << "start_cpu_time = std::clock();" + << endl; + stream << indent() << "std::string binary_name = " + << "boost::filesystem::path(opts.argv[0]).filename().string();" + << endl << endl; + stream << indent() << "if (opts.user_file_prefix.empty()) {" << endl; + inc_indent(); + stream << indent() << "file_prefix = binary_name + \"_\" + " + << "std::to_string(getpid());" << endl; + dec_indent(); + stream << indent() << "} else {" << endl; + inc_indent(); + stream << indent() << "file_prefix = opts.user_file_prefix;" << endl; + dec_indent(); + stream << indent() << "}" << endl << endl; + stream << indent() << "std::string logfile_name = file_prefix + " + << "\"_checkpointing_log.txt\";" << endl; + stream << indent() << "logfile_path = opts.checkpoint_out_path / " + << "logfile_name;" << endl << endl; + stream << indent() << "checkpoint_interval = opts.checkpoint_interval;" + << endl; + stream << indent() << "keep_archives = opts.keep_archives;" << endl; + stream << indent() << "std::string arg_string = " + << "get_arg_str(opts.argc, opts.argv);" << endl; + stream << indent() << "std::string formatted_interval = " + << "format_interval(checkpoint_interval);" << endl; + stream << indent() << "std::cerr << \"Checkpointing routine has been " + << "integrated. A new checkpoint will be \"" + << endl; + stream << indent() << " << \"created every \" << " + << "formatted_interval << \".\\n\"" << endl; + stream << indent() << " << \"The checkpoints will be saved " + << "at \" << opts.checkpoint_out_path << \".\\n\\n\";" + << endl << endl; + } + size_t track = 0; for (std::vector::const_iterator i = ast.seq_decls.begin(); i != ast.seq_decls.end(); @@ -1505,8 +1616,18 @@ void Printer::Cpp::print_table_init(const AST &ast) { if (ast.window_mode) { stream << " opts.window_size, opts.window_increment, "; } - stream << "\""<< i->second->table_decl->name() << "\");" << endl; + + stream << "\""<< i->second->table_decl->name() << "\""; + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + stream << ", opts.checkpoint_out_path," << endl; + stream << indent() << " opts.checkpoint_in_path, " + << "arg_string, formatted_interval," << endl; + stream << indent() << " file_prefix"; + } + stream << ");" << endl; } + + stream << endl; } @@ -1584,6 +1705,21 @@ void Printer::Cpp::print_init_fn(const AST &ast) { print_seq_init(ast); print_filter_init(ast); print_table_init(ast); + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + if (ast.checkpoint->strings || ast.checkpoint->subseq) { + stream << indent() << "if (!(opts.checkpoint_in_path.empty())) {" << endl; + inc_indent(); + if (ast.checkpoint->strings) { + stream << indent() << "restore_string_links();" << endl; + } + if (ast.checkpoint->subseq) { + stream << indent() << "add_seq_to_subseqs();" << endl; + } + dec_indent(); + stream << indent() << "}" << endl; + } + stream << indent() << "create_checkpoint_log(opts, arg_string);" << endl; + } print_zero_init(*ast.grammar()); print_most_init(ast); if (ast.window_mode) @@ -1689,15 +1825,46 @@ void Printer::Cpp::header(const AST &ast) { << endl; stream << "#define GAPC_VERSION_STRING \"" << gapc_version_string << "\"" << endl << endl; + + if (ast.checkpoint) { + /* + this macro always needs to be at the top of the header file + so the serialize methods of the rtlib datatypes are visible + to the preprocessor + */ + stream << "#define CHECKPOINTING_INTEGRATED" << endl; + + // include required (boost) header files + ast.checkpoint->include(stream, ast.grammar()->tabulated); + } + includes(); + print_subseq_typedef(ast); print_type_defs(ast); } + if (ast.checkpoint) { + // insert checkpointing accessor macros + ast.checkpoint->macros(stream); + } + imports(ast); print_hash_decls(ast); stream << indent() << "class " << class_name << " {" << endl; + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + stream << indent() << " private:" << endl; + inc_indent(); + stream << indent() << "typedef gapc::OptException ParseException;" + << endl << endl; + stream << indent() << "size_t checkpoint_interval;" << endl; + stream << indent() << "boost::filesystem::path logfile_path;" << endl; + stream << indent() << "std::clock_t start_cpu_time;" << endl; + stream << indent() << "std::string file_prefix;" << endl; + stream << indent() << "bool keep_archives;" << endl; + dec_indent(); + } stream << indent() << " public:" << endl; inc_indent(); @@ -2069,7 +2236,18 @@ void Printer::Cpp::print_run_fn(const AST &ast) { stream << indent() << *ast.grammar()->axiom->code()->return_type; stream << " run() {" << endl; inc_indent(); - stream << indent() << "return nt_" << *ast.grammar()->axiom_name << '('; + + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + stream << indent() << "std::atomic_bool cancel_token;" << endl; + stream << indent() << "archive_periodically(cancel_token, "; + stream << "checkpoint_interval" << ");" << endl; + stream << indent() << *ast.grammar()->axiom->code()->return_type; + stream << " ans = "; + } else { + stream << indent() << "return "; + } + + stream << "nt_" << *ast.grammar()->axiom_name << '('; bool first = true; size_t track = 0; @@ -2094,6 +2272,18 @@ void Printer::Cpp::print_run_fn(const AST &ast) { } stream << ");" << endl; + + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + stream << indent() << "cancel_token.store(false); " + "// stop periodic checkpointing" << endl; + stream << indent() << "if (!keep_archives) {" << endl; + inc_indent(); + stream << indent() << "remove_tables();" << endl; + stream << indent() << "remove_log_file();" << endl; + dec_indent(); + stream << indent() << "}" << endl; + stream << indent() << "return ans;" << endl; + } dec_indent(); stream << indent() << '}' << endl << endl; } @@ -2123,6 +2313,27 @@ void Printer::Cpp::print_stats_fn(const AST &ast) { void Printer::Cpp::header_footer(const AST &ast) { + dec_indent(); + stream << indent() << " private:" << endl; + inc_indent(); + if (ast.checkpoint && !ast.checkpoint->is_buddy) { + nt_tables &tabulated = ast.grammar()->tabulated; + ast.checkpoint->archive_periodically(stream, tabulated); + ast.checkpoint->remove_tables(stream, tabulated); + ast.checkpoint->remove_log_file(stream); + ast.checkpoint->format_interval(stream); + ast.checkpoint->get_arg_string(stream); + if (ast.checkpoint->strings) { + ast.checkpoint->restore_string_links(stream, tabulated); + ast.checkpoint->find_broken_listrefs(stream, tabulated); + } + if (ast.checkpoint->subseq) { + ast.checkpoint->add_seq_to_subseqs(stream, tabulated); + } + ast.checkpoint->create_checkpoint_log(stream, tabulated); + ast.checkpoint->update_checkpoint_log(stream, tabulated); + stream << endl; + } dec_indent(); stream << indent() << " public:" << endl; inc_indent(); @@ -2153,6 +2364,7 @@ void Printer::Cpp::footer(const AST &ast) { inc_indent(); } print_cyk_fn(ast); + print_id(); } @@ -2518,7 +2730,10 @@ void Printer::Cpp::makefile(const Options &opts) { stream << "DEPS = $(CXXFILES:.cc=.d)" << endl << "OFILES = $(CXXFILES:.cc=.o) string.o" << endl << endl; stream << opts.class_name << " : $(OFILES)" << endl - << "\t$(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS)"; + << "\t$(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS)"; + if (opts.checkpointing) { + stream << " -lboost_serialization -lboost_filesystem -lpthread -ldl"; + } // if (opts.sample) { // stream << " $(GSLLIBS) "; @@ -2599,8 +2814,8 @@ void Printer::Cpp::imports(const AST &ast) { } stream << endl; stream << "#include \"rtlib/generic_opts.hh\"\n"; - stream << "#include \"rtlib/pareto_dom_sort.hh\"\n"; - stream << "#include \"rtlib/pareto_yukish_ref.hh\"\n\n"; + stream << "#include \"rtlib/pareto_dom_sort.hh\"\n"; + stream << "#include \"rtlib/pareto_yukish_ref.hh\"\n\n"; } @@ -2933,6 +3148,22 @@ void Printer::Cpp::print(const Statement::Hash_Decl &d) { << endl; } + if (ast->checkpoint && !ast->checkpoint->is_buddy) { + stream << endl; + stream << indent() << "friend class boost::serialization::access;" + << endl << endl; + stream << indent() << "template " << endl; + stream << indent() << "void serialize(Archive &ar, " + << "const unsigned int version) {" << endl; + inc_indent(); + for (std::list::const_iterator i = f.begin(); + i != f.end(); ++i) { + stream << indent() << "ar & " << *(*i)->name << ";" << endl; + } + dec_indent(); + stream << indent() << "}" << endl << endl; + } + if (d.kbest()) { stream << indent() << "static uint32_t k_;\n"; } diff --git a/src/gapc.cc b/src/gapc.cc index fbd732b16..9fe5f055f 100644 --- a/src/gapc.cc +++ b/src/gapc.cc @@ -53,8 +53,6 @@ #include "printer/gap.hh" #include "specialize_grammar/create_specialized_grammar.hh" - - namespace po = boost::program_options; @@ -136,7 +134,16 @@ static void parse_options(int argc, char **argv, Options *rec) { " 3 = add data types.\n" " 4 = add min/max yield sizes.\n" " 5 = add non-terminal table dimensions.\n" - "(Use 'dot -Tpdf out.dot' to generate a PDF.)\nDefault file is out.dot"); + "(Use 'dot -Tpdf out.dot' to generate a PDF.)\nDefault file is out.dot") + ("checkpoint", std::string( + "enable periodic checkpointing of program progress.\n" + "Useful for long running programs that might crash intermediately.\n" + "You can continue from last checkpoint when re-executing the program.\n" + "Checkpointing interval can be configured in the generated binary\n" + "(creates new checkpoint every " + + std::to_string(DEFAULT_CP_INTERVAL_MIN) + + " minutes by default)\n").c_str()); + po::options_description hidden(""); hidden.add_options() ("backtrack", "deprecated for --backtrace") @@ -267,6 +274,9 @@ static void parse_options(int argc, char **argv, Options *rec) { rec->plot_grammar_file = basename(rec->out_file) + ".dot"; } + if (vm.count("checkpoint")) { + rec->checkpointing = true; + } bool r = rec->check(); if (!r) { @@ -560,6 +570,63 @@ class Main { // for example for Min or max choice functions driver.ast.instance_grammar_eliminate_lists(instance); + if (opts.checkpointing) { + if (driver.ast.checkpoint) { + /* + delete Checkpoint class if it exists already; + this is only the case if a classified/interleaved + product is parsed, in which case this method (back) + gets called twice: once for the buddy out class (1st call) + and once for the regular out class (2nd call) + */ + delete driver.ast.checkpoint; + } + + Printer::Checkpoint *cp = new Printer::Checkpoint(); + driver.ast.checkpoint = cp; + + if (opts.classified) { + /* + true if product is classified/interleaved product; + for this type of product, a buddy class is generated, + whose tables don't need to be checkpointed though, + so the table types will not be checked for compatibility; + this method will be called once more for the actual class, + in which case opts.classified will be false, + so the tables are regularly checked for compatibility and + the checkpointing routine will be inserted if that's the case + */ + cp->is_buddy = true; + } else { + if (opts.cyk) { + // since DP algorithm doesn't do lookups at the beginning of + // the nt_* functions in cyk-mode, the current checkpointing mechanism + // can't work in this case and won't be integrated + Log::instance()->error("Checkpointing routine could not be integrated" + ", because checkpointing mechanism is " + "currently incompatible with cyk-style " + "code generation."); + opts.checkpointing = false; + delete cp; + std::exit(0); + } + bool answer_type_supported = cp->is_supported(driver.ast.grammar()-> + tabulated); + + // only enable checkpointing if type of every table is supported + if (answer_type_supported) { + Log::instance()->normalMessage("Checkpointing routine integrated."); + } else { + Log::instance()->error("Checkpointing routine could not be " + "integrated, because (one of) the table " + "type(s) can't be serialized."); + opts.checkpointing = false; + delete cp; + std::exit(0); + } + } + } + Grammar *grammar = driver.ast.grammar(); grammar->init_list_sizes(); driver.ast.warn_missing_choice_fns(instance); diff --git a/src/options.hh b/src/options.hh index f496f4fde..6c9c9ad7a 100644 --- a/src/options.hh +++ b/src/options.hh @@ -57,7 +57,8 @@ struct Options { pareto(0), multiDimPareto(false), cutoff(65), float_acc(0), specialization(0), step_option(0), - plot_grammar(0), plotgrammar_stream_(NULL) { + plot_grammar(0), plotgrammar_stream_(NULL), + checkpointing(false) { } @@ -202,6 +203,9 @@ struct Options { return *plotgrammar_stream_; } + // provide option to enable checkpointing routine integration + bool checkpointing; + bool check(); }; diff --git a/src/symbol.cc b/src/symbol.cc index 398ddfd29..612504d99 100644 --- a/src/symbol.cc +++ b/src/symbol.cc @@ -1067,7 +1067,8 @@ void Symbol::NT::init_table_decl(const AST &ast) { Tablegen tg; tg.set_window_mode(ast.window_mode); - table_decl = tg.create(*this, t, ast.code_mode() == Code::Mode::CYK); + table_decl = tg.create(*this, t, ast.code_mode() == Code::Mode::CYK, + ast.checkpoint && !ast.checkpoint->is_buddy); } #include diff --git a/src/tablegen.cc b/src/tablegen.cc index 4a6523cb0..81a84543c 100644 --- a/src/tablegen.cc +++ b/src/tablegen.cc @@ -49,7 +49,8 @@ Tablegen::Tablegen() cond(0), dtype(0), cyk_(false), - window_mode_(false) { + window_mode_(false), + checkpoint_(false) { // FIXME? type = new ::Type::Size(); @@ -351,8 +352,10 @@ void Tablegen::offset(size_t track_pos, itr f, const itr &e) { #include "symbol.hh" Statement::Table_Decl *Tablegen::create(Symbol::NT &nt, - std::string *name, bool cyk) { + std::string *name, bool cyk, bool checkpoint) { cyk_ = cyk; + checkpoint_ = checkpoint; // is checkpointing activated? + std::list ors; nt.gen_ys_guards(ors); if (!ors.empty()) @@ -467,6 +470,22 @@ Fn_Def *Tablegen::gen_tab() { a->add_arg(new Expr::Less(off, new Expr::Fn_Call(new std::string("size")))); c.push_back(a); + if (checkpoint_) { + // create a std::lock_guard object and lock the table's mutex + // to ensure that the archiving thread + // can't read the array while the value is being set + Statement::Fn_Call *lock_guard = new Statement::Fn_Call( + "std::lock_guard lock"); + // "m" is the mutex object + lock_guard->add_arg(new std::string("m")); + c.push_back(lock_guard); + + // increase the counter tracking how many cells have been tabulated + Statement::Increase *inc_tab_c = new Statement::Increase( + new std::string("tabulated_vals_counter")); + c.push_back(inc_tab_c); + } + Statement::Var_Assign *x = new Statement::Var_Assign( new Var_Acc::Array(new Var_Acc::Plain(new std::string("array")), off), new Expr::Vacc(new std::string("e"))); diff --git a/src/tablegen.hh b/src/tablegen.hh index b8494cfdc..89fe07d9f 100644 --- a/src/tablegen.hh +++ b/src/tablegen.hh @@ -67,6 +67,7 @@ class Tablegen { bool cyk_; bool window_mode_; + bool checkpoint_; void head(Expr::Base *&i, Expr::Base *&j, Expr::Base *&n, const Table &table, size_t track); @@ -95,7 +96,7 @@ class Tablegen { void offset(size_t track_pos, itr first, const itr &end); Statement::Table_Decl *create(Symbol::NT &nt, - std::string *name, bool cyk); + std::string *name, bool cyk, bool checkpoint); }; diff --git a/testdata/gapc_filter/adpf_filter.hh b/testdata/gapc_filter/adpf_filter.hh index 3c7206c09..38800a47e 100644 --- a/testdata/gapc_filter/adpf_filter.hh +++ b/testdata/gapc_filter/adpf_filter.hh @@ -5,6 +5,14 @@ template struct p_func_filter { +#ifdef CHECKPOINTING_INTEGRATED + friend class boost::serialization::access; + + template + void serialize(Archive &ar, const unsigned int version) { + ar & sum; + } +#endif double sum; p_func_filter() : sum(0) {} diff --git a/testdata/grammar/adpf.gap b/testdata/grammar/adpf.gap index c40b7170d..298e67066 100644 --- a/testdata/grammar/adpf.gap +++ b/testdata/grammar/adpf.gap @@ -706,5 +706,7 @@ instance shapemfeppshcl = fold ( (shape5 / mfe) * (pretty*shape5) ) ; instance prettyshape = fold ( pretty * shape5 ) ; +instance mfepf = fold ( mfe * p_func) ; + diff --git a/testdata/regresstest/config b/testdata/regresstest/config index d3dd2dd0a..76e91eec5 100644 --- a/testdata/regresstest/config +++ b/testdata/regresstest/config @@ -436,7 +436,24 @@ GRAMMAR=../../grammar GAPC="../../../gapc --float-accuracy 2" check_new_old_eq elm.gap unused pareto "1+2*3+4*5" floatacc +GAPC="../../../gapc --checkpoint" +# int +check_checkpoint_eq adpf.gap unused mfe "GCUUCACAUCUCGGGCAUUUUCCUGCAAAACCAUACCCUUACGAAAAGUACGGCAUUGAUAAUCAUUUUCAAUAUCAUUUAAUUAACUAUAAUGAACCAACUGCUUACGCGGCAUUAACAAUCGGCCGCCCGACAAUACUGGAGAUGAAUAUGAGCUAUACCCUGCCAUCCCUGCCGUAUGCUUACGAUGCCCUGGAACCGCACUUCGAUAAGCAGACCAUGGAAAUCCACCACACCAAACACCAUCAGACCUACGUAAACAACGCCAACGCGGCGCUGGAAAGCCUGCCAGAAUUUGCCAACCUGCCGGUUGAAGAGCUGAUCACCAAACUGGACCAGCUGCCAGCAGACAAGAAAACCGUACUGCGCAACAACGCUGGCGGUCACGCUAACCACAGCCUGUUCUGGAAAGGUCUGAAAAAAGGCACCACCCUGCAGGGUGACCUGAAAGCGGCUAUCGAACGUGACUUCGGCUCCGUUGAUAACUUCAAAGCAGAAUUUGAAAAAGCGGCAGCUUCCCGCUUUGGUUCCGGCUGGGCAUGGCUGGUGCUGAAAGGCGAUAAACUGGCGGUGGUUUCUACUGCUAACCAGGAUUCUCCGCUGAUGGGUGAAGCUAUUUCUGGCGCUUCCGGCUUCCCGAUUAUGGGCCUGGAUGUGUGGGAACAUGCUUACUACCUGAAAUUCCAGAACCGCCGUCCGGACUACAUUAAAGAGUUCUGGAACGUGGUGAACUGGGACGAAGCAGCGGCACGUUUUGCGGCGAAAAAAUAA" checkpoint1 1 +# int +check_checkpoint_eq adpf.gap unused mfe "GUAAAAUAAACAACGCUGAUAUUAGCCGUAAACAUCGGGUUUUUUACCUCGGUAUGCCUUGUGACUGGCUUGACAAGCUUUUCCUCAGCUCCGUAAACUCCUUUCAGUGGGAAAUUGUGGGGCAAAGUGGGAAUAAGGGGUGAGGCUGGCAUGUUCCGGGGAGCAACGUUAGUCAAUCUCGACAGCAAAGGGCGCUUAUCAGUGCCUACCCGUUAUCGGGAACAGCUGCUUGAGAACGCUGCCGGUCAAAUGGUUUGCACCAUUGACAUUUAUCACCCGUGCCUGCUGCUUUACCCCCUGCCUGAAUGGGAAAUUAUCGAGCAAAAAUUAUCGCGUCUGUCGAGCAUGAACCCGGUUGAGCGCCGUGUGCAGCGCCUACUGUUAGGUCAUGCCAGCGAAUGUCAGAUGGAUGGCGCAGGUCGAUUGUUAAUCGCGCCAGUACUGCGGCAACAUGCCGGGCUGACAAAAGAAGUGAUGCUGGUUGGACAGUUCAACAAGUUUGAGCUGUGGGAUGAAACAACCUGGCAUCAACAGGUCAAGGAAGAUAUCGACGCAGAGCAGUUGGCUACCGGAGACUUAUCGGAGCGACUGCAGGACUUGUCUCUAUAAACGAUCUGACGAGCGAUCUAGCGAGCAUCGAUCUGAUCAUCUACUAUCUAUUCUAUCUAUCGGGGUGUCGACGAUCU" checkpoint2 1 +# int +check_checkpoint_eq adpf.gap unused mfe "GUUGUAGACUUUACAUCGCCAGGGGUGCUCGGCAUAAGCCGAAGAUAUCGGUAGAGUUAAUAUUGAGCAGAUCCCCCGGUGAAGGAUUUAACCGUGUUAUCUCGUUGGAGAUAUUCAUGGCGUAUUUUGGAUGAUAACGAGGCGCAAAAAAUGAAAAAGACAGCUAUCGCGAUUGCAGUGGCACUGGCUGGUUUCGCUACCGUAGCGCAGGCCGCUCCGAAAGAUAACACCUGGUACACUGGUGCUAAACUGGGCUGGUCCCAGUACCAUGACACUGGUUUCAUCAACAACAAUGGCCCGACCCAUGAAAACCAACUGGGCGCUGGUGCUUUUGGUGGUUACCAGGUUAACCCGUAUGUUGGCUUUGAAAUGGGUUACGACUGGUUAGGUCGUAUGCCGUACAAAGGCAGCGUUGAAAACGGUGCAUACAAAGCUCAGGGCGUUCAACUGACCGCUAAACUGGGUUACCCAAUCACUGACGACCUGGACAUCUACACUCGUCUGGGUGGCAUGGUAUGGCGUGCAGACACUAAAUCCAACGUUUAUGGUAAAAACCACGACACCGGCGUUUCUCCGGUCUUCGCUGGCGGUGUUGAGUACGCGAUCACUCCUGAAAUCGCUACCCGUCUGGAAUACCAGUGGACCAACAACAUCGGUGACGCACACACCAUCGGCACUCGUCCGGACAACGGCAUGCUGAGCCUGGGUGUUUCCUACCGUUUCGGUCAGGGCG" checkpoint3 1 +# List_Ref +check_checkpoint_eq adpf.gap unused mfepp "CGUAGUCGUAGUUCUGAGUCGUAGUCGUAGUCGUGUACUGAGUGCUGUAGUCGUAGUCGUAGUCGUAGUCGUGUAGUCGUAGUCGUAGUCGUAGUCGUAGUCUGUGAGUCGUAGUCGUAGUCGUAGUCGUAcGUCAGCGAGUCGUAGUCGUAGUCGUAGUCGAGUAGUCAGUCUGAGCAGUCUAGUGCUGUAGUCGUAGUCGUAGUCUGCUGACGUCGUAUGCGUAGUCGUAGUCGUAGUCGUAGUCGUAGUCGUAGUCGUGUCGUAGUCGUAGUCAGUCGUAGUCGUAGUCGUAGUGUC" checkpoint4 1 +# std::pair +check_checkpoint_eq adpf.gap unused mfeen "CGAGCGGUACUGAGUCGUAGUGUAGUGCUCGUAGUCGUAGUCGUAGUCGUAGCUGAUCGUAGUAGUCGUCGUAGUCGUAGUCGUCGUAGCGUAGUCGUAGUCGUAGUCAGUCGUGUCGUGUACGUAGUCGUCAGUGCGAUCGUGUCGUAGUCGUCGUAGUCGUAGUCGAGUCAGUCGUAGUAGUGCUGAUCGUgauCGUAGCGUA" checkpoint5 1 +# Hash::Ref> +check_checkpoint_eq adpf.gap unused shape5pfx "CGAGCGUAGUCGUAGCguCGUAGCGUAGUCGUAGUCGUGCUGAGUCguaCAGUCGGAGCUAGUCGUAGUCGUAGUCGUAGCUAGUCGUCGUAGUCGUAGUCGAGUCGUACGUCGUAGCGUAGUCGUAGCUAGUGUAGCUCGUAGUCGUGUCACACCGUAUA" checkpoint6 1 +GAPC="../../../gapc --checkpoint --sample" +# double + Backtrace +check_checkpoint_eq adpf.gap unused pfsampleshape "CGAGCGGUACUGAGUCGUAGUGUAGUGCUCGUAGUCGUAGUCGUAGUCGUAGCUGAUCGUAGUAGUCGUCGUAGUCGUAGUCGUCGUAGCGUAGUCGUAGUCGUAGUCAGUCGUGUCGUGUACGUAGUCGUCAGUGCGAUCGUGUCGUAGUCGUCGUAGUCGUAGUCGAGUCAGUCGUAGUAGUGCUGAUCGUgauCGUAGCGUACGUACGUAGUCGUAGUCGUAGUCGUAGUCGAGUCCGUAGUCGUAGUCGUAGUCGUAGUCGUGUACGUACGUGUACGGUCGUAGUCGUAGCUguCGUAGCGUAGUCGUAGUCGUAGUCGUAGUCAGUCGUAGUGUAGUGUCGUCGUCGUAGUCGUAGUCGUAGUCAGUCGUAGUCGUAGUCGUAGUCGAUGUAGUGUCGUAGUCAGUCUGAGUCGUAGCGUAGUCGAUGUCAGUCGUAGUCGUAGUCGUAGUCGAUGCUAGUCCUGAGUCGUAGUCGUAGUCGAUCGUAGCUGAUCGUCGUAGUCGUAGUCGAGUCGACGUAGUCGUACGUAGUCGUACGUAGUCGUAGUACGUAGUGUACguCGUA" checkpoint7 1 GAPC="../../../gapc" +RUN_CPP_FLAGS="" check_new_old_eq empty_ys_issue.gap unused count "A" Ashouldbe0 check_new_old_eq empty_ys_issue.gap unused count "AA" AAshouldbe1 check_new_old_eq empty_ys_issue.gap unused count "AAA" AAAshouldbe0 diff --git a/testdata/regresstest/run.sh b/testdata/regresstest/run.sh old mode 100644 new mode 100755 index 595c7267c..834ce4ba2 --- a/testdata/regresstest/run.sh +++ b/testdata/regresstest/run.sh @@ -78,6 +78,53 @@ cmp_new_old_output() log diff -u -w -B a b } +check_checkpoint_eq() +{ + # check if checkpoints are created/loaded correctly and if + # answers if the program starts from a checkpoint are still correct + + if [[ `echo $1$3$5 | grep $FILTER` != $1$3$5 ]]; then + return + fi + + # work around 1 sec timestamp filesystems ... WTF?!? + sleep 1 + + echo +------------------------------------------------------------------------------+ + failed=0 + temp=$failed + + cpp_base=${1%%.*} + build_cpp $GRAMMAR/$1 $cpp_base $3 + + # run command and create checkpoint archives after $6 seconds + RUN_CPP_FLAGS="--checkpointInterval 0:0:0:$6 --keepArchives" + ./$cpp_base $RUN_CPP_FLAGS $4 > /dev/null & + PID=$! + + # wait for background process to finish + wait $PID + + # specify Logfile path and run command again (it will load the checkpoints this time) + LOGFILE_PATH=$PWD"/"$cpp_base"_"$PID"_checkpointing_log.txt" + TABLE_PATH=$PWD"/"$cpp_base"_"$PID"_*_table" + RUN_CPP_FLAGS="--checkpointInput $LOGFILE_PATH" + + run_cpp $cpp_base $3 $4 $5 + cmp_new_old_output $cpp_base $REF $3 $5 + + if [ $temp != $failed ]; then + echo --++--FAIL--++-- + err_count=$((err_count+1)) + else + echo OK + succ_count=$((succ_count+1)) + # remove the table archives and Logfile after successfully finishing the test + rm -f string.o $TABLE_PATH $LOGFILE_PATH + fi + echo +------------------------------------------------------------------------------+ +} + check_new_old_eq() { if [[ `echo $1$3$5 | grep $FILTER` != $1$3$5 ]]; then