grap-1.49/0000775000175000017500000000000015000076444007403 500000000000000grap-1.49/strdup.cc0000664000175000017500000000045314546364223011166 00000000000000#ifdef STDC_HEADERS #include #endif extern "C" { void * malloc(size_t size); }; char *strdup(const char *s) { int len = strlen(s)+1; char *t; int i; if ( !(t = (char *) malloc(len)) ) return 0; else for ( i = 0; i < len; i++ ) t[i] = s[i]; return t; } grap-1.49/snprintf.h0000664000175000017500000001477714546364223011370 00000000000000// -*-c++-*- #ifndef SNPRINTF_H #define SNPRINTF_H // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. #ifndef HAVE_SNPRINTF // Snprintf is only called with the following 11 signatures. Enumerating them // is ugly, but probably more portable than varargs. And very few systems have // no snprintf. It's conceivable that someone could smash the stack here, but // there's not much privilege to gain, and I'd be impressed enough if you could // print a float that caused a stack overflow and error that you can break the // code. inline int snprintf(char *s, int lim, const char *fmt) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt); tot = lim; #else if ( (tot = sprintf(s,fmt)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d); tot = lim; #else if ( (tot = sprintf(s,fmt,d)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4, double d5) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4, d5); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4, d5)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4, double d5, double d6) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4, d5, d6); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4, d5, d6)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4, double d5, double d6, double d7) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7, d8); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7, d8)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7, d8, d9); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7, d8, d9)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } inline int snprintf(char *s, int lim, const char *fmt, double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10) { int tot; #ifdef SPRINTF_NOT_INT // For some reason some old versions of SunOS have an sprintf that // doesn't return an int. In this case, we can't bounds check at all. sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7, d8, d9, d10); tot = lim; #else if ( (tot = sprintf(s,fmt,d1, d2, d3, d4, d5, d6, d7, d8, d9, d10)) > lim ) { std::cerr << "Bad format to internal sprintf crashed the stack" << std::endl; abort(); } #endif return tot; } #endif #endif grap-1.49/configure0000775000175000017500000055405515000074631011244 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for grap 1.49. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; 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 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 ${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 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) 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 test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; 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'. 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="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 \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 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 : 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 : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : 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 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 if { test -f "$as_shell" || test -f "$as_shell.exe"; } && 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done 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 : 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 # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi 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 printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and faber@lunabase.org $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e 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 # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # 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 : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # 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 : eval 'as_fn_arith () { as_val=$(( $* )) }' 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] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO 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'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { 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 # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. 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*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) 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 else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='grap' PACKAGE_TARNAME='grap' PACKAGE_VERSION='1.49' PACKAGE_STRING='grap 1.49' PACKAGE_BUGREPORT='faber@lunabase.org' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_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= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS GRAPLIBOBJS INSTALL_DEPS LIBOBJS EGREP GREP INSTALL_DOCS DOC_DIR EXAMPLE_DIR DEFINES_DIR CX0FLAGS OS_VERSION YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX SUPPRESS_OPT NO_UNDEF GXXFLAGS CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_defines_dir with_example_dir with_doc_dir enable_optimize_grap_tokenizer with_freebsd_ports with_safer_mode ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CXXCPP YACC YFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) 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'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures grap 1.49 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/grap] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of grap 1.49:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-optimize-grap_tokenizer do not prevent optimization of the grap_tokenize.cc file Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-defines-dir=dir directory in which to install grap.defines --with-example-dir=dir directory in which to install examples --with-doc-dir=dir directory in which to install documents --with-freebsd-ports configure called by a FreeBSD ports makefile --with-safer-mode disable sprintf to avoid attacks Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXXCPP C++ preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. 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/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # 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 elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF grap configure 1.49 generated by GNU Autoconf 2.71 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 exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 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 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 : ac_retval=0 else $as_nop printf "%s\n" "$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_compile # 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\"" printf "%s\n" "$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 printf "%s\n" "$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_nop printf "%s\n" "$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_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. 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.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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 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 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 : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { 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 : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { 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 # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { 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 (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { 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_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 { 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. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { 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 grap $as_me 1.49, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME 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 printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # 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 printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_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) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && 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 && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h 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. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do 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" \ || { { 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 done 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 { 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 { 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 # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " as_fn_append ac_header_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="missing install-sh" # 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_headers="$ac_config_headers config.h" am__api_version='1.16' # 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 # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # 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. { 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 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 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/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # 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 test $ac_prog = install && 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 # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir 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/" && 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" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi 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 # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { 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. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" 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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&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_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" 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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } 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 { 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 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_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='grap' VERSION='1.49' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi 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 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 if test -z "$CXX"; then if test -n "$CCC"; 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 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 { 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 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_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done 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 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 { 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 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_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" 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 CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. 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 { { 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files 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. { 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.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? 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, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi 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 { { 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_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 { 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done 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 { 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 ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _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. { 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 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? 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 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? 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 { { 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 { 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 { 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 (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? 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 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { 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 { 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 { 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 (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { 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+y} ac_save_CXXFLAGS=$CXXFLAGS { 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 CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : 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 (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { 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 CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" 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_11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_98+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 fi fi ac_ext=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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /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. # 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. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else $as_nop # 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 $as_nop # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$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. # 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. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else $as_nop # 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 $as_nop # 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_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 $? "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 # Set g++ specific compiler options if test "$GXX" = "yes" ; then GXXFLAGS="-Wall" else GXXFLAGS="" fi # Set g++ specific compiler options if test "$GXX" = "yes" ; then NO_UNDEF="-Wno-unused" else NO_UNDEF="" fi # Set g++ specific compiler options if test "$GXX" = "yes" ; then SUPPRESS_OPT="-O0" else SUPPRESS_OPT="" fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LEX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_LEX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 printf "%s\n" "$LEX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %{ #ifdef __cplusplus extern "C" #endif int yywrap(void); %} %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ #ifdef __cplusplus yyless ((yyinput () != 0)); #else yyless ((input () != 0)); #endif } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int yywrap (void) { return 1; } int main (void) { return ! yylex (); } _ACEOF { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 printf %s "checking for lex output file root... " >&6; } if test ${ac_cv_prog_lex_root+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_lex_root=unknown { { ac_try="$LEX conftest.l" 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 printf "%s\n" "$ac_cv_prog_lex_root" >&6; } if test "$ac_cv_prog_lex_root" = unknown then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} LEX=: LEXLIB= fi LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test ${LEXLIB+y} then : else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 printf %s "checking for lex library... " >&6; } if test ${ac_cv_lib_lex+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_LIBS="$LIBS" ac_found=false for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do case $ac_cv_lib_lex in #( 'none needed') : ;; #( 'not found') : break ;; #( *) : LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( *) : ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_cxx_try_link "$LINENO" then : ac_found=: fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if $ac_found; then break fi done LIBS="$ac_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 printf "%s\n" "$ac_cv_lib_lex" >&6; } if test "$ac_cv_lib_lex" = 'not found' then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} LEX=: LEXLIB= elif test "$ac_cv_lib_lex" = 'none needed' then : LEXLIB='' else $as_nop LEXLIB=$ac_cv_lib_lex fi fi if test "$LEX" != : then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 printf %s "checking whether yytext is a pointer... " >&6; } if test ${ac_cv_prog_lex_yytext_pointer+y} then : printf %s "(cached) " >&6 else $as_nop # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h fi fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 printf "%s\n" "$YACC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OS version" >&5 printf %s "checking for OS version... " >&6; } if test ${tvf_cv_os_version+y} then : printf %s "(cached) " >&6 else $as_nop tvf_cv_os_version=`uname -sr` fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tvf_cv_os_version" >&5 printf "%s\n" "$tvf_cv_os_version" >&6; } OS_VERSION=$tvf_cv_os_version printf "%s\n" "#define OS_VERSION \"$OS_VERSION\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if ${CXX} supports -std=c++0x" >&5 printf %s "checking if ${CXX} supports -std=c++0x... " >&6; } old_cxxflags="$CXXFLAGS" old_cppflags="$CPPFLAGS" CXXFLAGS="$CXXFLAGS -std=c++0x" CPPFLAGS="$CPPFLAGS -std=c++0x" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : CX0FLAGS="-std=c++0x" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else $as_nop CX0FLAGS="" CXXFLAGS="$old_cxxflags" CPPFLAGS="$old_cppflags" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Check whether --with-defines-dir was given. if test ${with_defines_dir+y} then : withval=$with_defines_dir; DEFINES_DIR=$withval else $as_nop DEFINES_DIR="$datadir/grap" fi # Check whether --with-example-dir was given. if test ${with_example_dir+y} then : withval=$with_example_dir; EXAMPLE_DIR=$withval else $as_nop EXAMPLE_DIR="$datadir/examples/grap" fi # Check whether --with-doc-dir was given. if test ${with_doc_dir+y} then : withval=$with_doc_dir; DOC_DIR=$withval else $as_nop DOC_DIR="$datadir/doc/grap" fi # Autoupdate added the next two lines to ensure that your configure # script's behavior did not change. They are probably safe to remove. printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h 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 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 { 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 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS 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" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "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 if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" ac_fn_cxx_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes then : printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi ac_fn_cxx_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes then : printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h fi ac_fn_cxx_check_header_compile "$LINENO" "limits" "ac_cv_header_limits" "$ac_includes_default" if test "x$ac_cv_header_limits" = xyes then : printf "%s\n" "#define HAVE_LIMITS 1" >>confdefs.h fi ac_fn_cxx_check_header_compile "$LINENO" "unordered_map" "ac_cv_header_unordered_map" "$ac_includes_default" if test "x$ac_cv_header_unordered_map" = xyes then : printf "%s\n" "#define HAVE_UNORDERED_MAP 1" >>confdefs.h fi ac_fn_cxx_check_header_compile "$LINENO" "hash_map" "ac_cv_header_hash_map" "$ac_includes_default" if test "x$ac_cv_header_hash_map" = xyes then : printf "%s\n" "#define HAVE_HASH_MAP 1" >>confdefs.h fi ac_fn_cxx_check_header_compile "$LINENO" "ext/hash_map" "ac_cv_header_ext_hash_map" "$ac_includes_default" if test "x$ac_cv_header_ext_hash_map" = xyes then : printf "%s\n" "#define HAVE_EXT_HASH_MAP 1" >>confdefs.h fi printf "%s\n" "#define HASH_SPACE std" >>confdefs.h 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 : else $as_nop printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_cxx_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes then : printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h fi if test "$ac_cv_func_snprintf" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of snprintf" >&5 printf %s "checking for declaration of snprintf... " >&6; } if test ${tvf_cv_decl_snprintf+y} then : printf %s "(cached) " >&6 else $as_nop for f in stdio.h; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$f> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "snprintf" >/dev/null 2>&1 then : tvf_cv_decl_snprintf="yes" else $as_nop tvf_cv_decl_snprintf="no" fi rm -rf conftest* if test $tvf_cv_decl_snprintf = "yes"; then break; fi done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tvf_cv_decl_snprintf" >&5 printf "%s\n" "$tvf_cv_decl_snprintf" >&6; } if test "$tvf_cv_decl_snprintf" = "yes"; then printf "%s\n" "#define SNPRINTF_DECLARED 1" >>confdefs.h fi fi ac_fn_cxx_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes then : printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h else $as_nop case " $LIBOBJS " in *" strdup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ;; esac fi if test "$ac_cv_func_strdup" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strdup" >&5 printf %s "checking for declaration of strdup... " >&6; } if test ${tvf_cv_decl_strdup+y} then : printf %s "(cached) " >&6 else $as_nop for f in stdio.h string.h; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$f> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strdup" >/dev/null 2>&1 then : tvf_cv_decl_strdup="yes" else $as_nop tvf_cv_decl_strdup="no" fi rm -rf conftest* if test $tvf_cv_decl_strdup = "yes"; then break; fi done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tvf_cv_decl_strdup" >&5 printf "%s\n" "$tvf_cv_decl_strdup" >&6; } if test "$tvf_cv_decl_strdup" = "yes"; then printf "%s\n" "#define STRDUP_DECLARED 1" >>confdefs.h fi 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 else $as_nop case " $LIBOBJS " in *" strerror.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strerror.$ac_objext" ;; esac fi if test "$ac_cv_func_strerror" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strerror" >&5 printf %s "checking for declaration of strerror... " >&6; } if test ${tvf_cv_decl_strerror+y} then : printf %s "(cached) " >&6 else $as_nop for f in stdio.h string.h; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$f> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1 then : tvf_cv_decl_strerror="yes" else $as_nop tvf_cv_decl_strerror="no" fi rm -rf conftest* if test $tvf_cv_decl_strerror = "yes"; then break; fi done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tvf_cv_decl_strerror" >&5 printf "%s\n" "$tvf_cv_decl_strerror" >&6; } if test "$tvf_cv_decl_strerror" = "yes"; then printf "%s\n" "#define STRERROR_DECLARED 1" >>confdefs.h fi fi printf "%s\n" "#define HAVE_RANDOM 1" >>confdefs.h printf "%s\n" "#define RANDOM_DECLARED 1" >>confdefs.h if test "$ac_cv_header_unistd_h" = "yes" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for optarg in unistd.h" >&5 printf %s "checking for optarg in unistd.h... " >&6; } if test ${tvf_cv_header_optarg+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "optarg" >/dev/null 2>&1 then : tvf_cv_header_optarg="yes"; else $as_nop tvf_cv_header_optarg="no" fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tvf_cv_header_optarg" >&5 printf "%s\n" "$tvf_cv_header_optarg" >&6; } if test "$tvf_cv_header_optarg" = "yes"; then printf "%s\n" "#define OPTARG_DEFINED 1" >>confdefs.h fi fi if test "$ac_cv_func_snprintf" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sprintf returns an int" >&5 printf %s "checking if sprintf returns an int... " >&6; } if test ${grap_cv_sprintf_int+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : echo "" else $as_nop # ac_fn_cxx_try_run LINENO # ------------------------ # 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 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 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 fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int argc, char **argv) { char a[10]; if ( (char *) sprintf(a,"ten") == a ) return 1; else return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO" then : grap_cv_sprintf_int="yes" else $as_nop grap_cv_sprintf_int="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $grap_cv_sprintf_int" >&5 printf "%s\n" "$grap_cv_sprintf_int" >&6; } if test "$grap_cv_sprintf_int" = "no" ; then printf "%s\n" "#define SPRINTF_NOT_INT 1" >>confdefs.h fi fi test "x$prefix" = xNONE && prefix="$ac_default_prefix" # expand the data directory parameter. Repeatedly eval the contents # of ddir until it has no $ in it. ddir=$datadir while echo $ddir | grep '\$' > /dev/null ; do ddir=`eval echo $ddir` done printf "%s\n" "#define DEFINES \"${ddir}/grap/grap.defines\"" >>confdefs.h # expand the examples directory parameter. Repeatedly eval the contents # of ddir until it has no $ in it. ddir=$EXAMPLE_DIR while echo $ddir | grep '\$' > /dev/null ; do ddir=`eval echo $ddir` done printf "%s\n" "#define EXAMPLES_DIR \"${ddir}\"" >>confdefs.h # expand the data directory parameter. Repeatedly eval the contents # of ddir until it has no $ in it. ddir=$DOC_DIR while echo $ddir | grep '\$' > /dev/null ; do ddir=`eval echo $ddir` done printf "%s\n" "#define DOCS_DIR \"${ddir}\"" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to optimize grap_tokenizer" >&5 printf %s "checking whether to optimize grap_tokenizer... " >&6; } # Check whether --enable-optimize-grap_tokenizer was given. if test ${enable_optimize_grap_tokenizer+y} then : enableval=$enable_optimize_grap_tokenizer; ac_cv_grap_opt_tok="yes" else $as_nop if test ${ac_cv_grap_opt_tok+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_grap_opt_tok="no" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_grap_opt_tok" >&5 printf "%s\n" "$ac_cv_grap_opt_tok" >&6; } if test "$ac_cv_grap_opt_tok" = "yes" ; then SUPPRESS_OPT="" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether configure called from a FreeBSD port" >&5 printf %s "checking whether configure called from a FreeBSD port... " >&6; } # Check whether --with-freebsd-ports was given. if test ${with_freebsd_ports+y} then : withval=$with_freebsd_ports; ac_cv_grap_opt_port="yes" else $as_nop if test ${ac_cv_grap_opt_port+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_grap_opt_port="no" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_grap_opt_port" >&5 printf "%s\n" "$ac_cv_grap_opt_port" >&6; } if test $ac_cv_grap_opt_port = "no" ; then INSTALL_DEPS="all grap.defines grap.1 install-docs" else INSTALL_DEPS="all grap.defines grap.1" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to force safer mode" >&5 printf %s "checking whether to force safer mode... " >&6; } # Check whether --with-safer-mode was given. if test ${with_safer_mode+y} then : withval=$with_safer_mode; ac_cv_grap_safer_mode="yes" else $as_nop if test ${ac_cv_grap_safer_mode+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_grap_safer_mode="no" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_grap_safer_mode" >&5 printf "%s\n" "$ac_cv_grap_safer_mode" >&6; } if test $ac_cv_grap_safer_mode = "yes" ; then printf "%s\n" "#define GRAP_SAFER 1" >>confdefs.h fi GRAPLIBOBJS=$LIBOBJS ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_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) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear 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 { 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 case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { 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 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= 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=`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" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { 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 # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; 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 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 ${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 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) 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 test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi 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. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. 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 : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # 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 : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' 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*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) 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 else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by grap $as_me 1.49, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands 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='$ac_cs_config_escaped' ac_cs_version="\\ grap config.status 1.49 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" 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." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) 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=`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;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF 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 \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # 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+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; 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 # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { 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=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. 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/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { 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=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 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"; } && { 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 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" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { 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 $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { 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 grap-1.49/ylwrap0000755000175000017500000001531414215102164010565 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: grap-1.49/configure.ac0000664000175000017500000001411715000074616011614 00000000000000dnl -*-m4-*- dnl Process this file with autoconf to produce a configure script. dnl NB grap.m4 moved to source dir for automake m4_include([grap.m4]) AC_INIT([grap],[1.49],[faber@lunabase.org]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE AC_LANG([C++]) dnl for autoheader AH_TEMPLATE([DEFINES], [The pathname of the grap.defines file]) AH_TEMPLATE([DOCS_DIR], [The directory for documentation]) AH_TEMPLATE([EXAMPLES_DIR], [The directory for examples]) AH_TEMPLATE([GRAP_SAFER], [True if the grap sprintf command is disabled]) AH_TEMPLATE([HASH_SPACE], [C++ namespace where hash_map lives]) AH_TEMPLATE([OPTARG_DEFINED], [True if optarg is defined by headers]) AH_TEMPLATE([OS_VERSION], [OS version]) AH_TEMPLATE([HAVE_RANDOM], [Define to 1 if you have the random function]) AH_TEMPLATE([RANDOM_DECLARED], [True if random() is declared]) AH_TEMPLATE([RANDOM_IN_MATH], [True if random() is declared in math.h]) AH_TEMPLATE([RAND_DECLARED], [True if rand() is declared]) AH_TEMPLATE([RAND_IN_MATH], [True if rand() is declared in math.h]) AH_TEMPLATE([SNPRINTF_DECLARED], [Is snprintf declared?]) AH_TEMPLATE([SPRINTF_NOT_INT], [True if sprintf does not return an integer]) AH_TEMPLATE([STRDUP_DECLARED], [True if strdup is declared]) AH_TEMPLATE([STRERROR_DECLARED], [True if strerror is declared]) dnl Note to self: it's possible to get separate tables out of byacc. It dnl is confusing because g++ optimizes away the const static tables that dnl byacc generates, and compiling those tables aren't the problem dnl anyway. So don't try it again. dnl Checks for programs. AC_PROG_CXX AC_PROG_CXXCPP dnl Set g++ specific compiler options TVF_PROG_GXX_SUBST(GXXFLAGS,-Wall) TVF_PROG_GXX_SUBST(NO_UNDEF,-Wno-unused) TVF_PROG_GXX_SUBST(SUPPRESS_OPT,-O0) AC_PROG_LEX(noyywrap) AC_PROG_YACC AC_PROG_INSTALL TVF_OS_VERSION AC_MSG_CHECKING(if ${CXX} supports -std=c++0x) old_cxxflags="$CXXFLAGS" old_cppflags="$CPPFLAGS" CXXFLAGS="$CXXFLAGS -std=c++0x" CPPFLAGS="$CPPFLAGS -std=c++0x" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ CX0FLAGS="-std=c++0x" AC_MSG_RESULT(yes) ],[ CX0FLAGS="" CXXFLAGS="$old_cxxflags" CPPFLAGS="$old_cppflags" AC_MSG_RESULT(no) ]) AC_SUBST(CX0FLAGS) AC_ARG_WITH(defines-dir, [ --with-defines-dir=dir directory in which to install grap.defines], AC_SUBST(DEFINES_DIR,$withval), AC_SUBST(DEFINES_DIR, "$datadir/grap")) AC_ARG_WITH(example-dir, [ --with-example-dir=dir directory in which to install examples], AC_SUBST(EXAMPLE_DIR,$withval), AC_SUBST(EXAMPLE_DIR, "$datadir/examples/grap")) AC_ARG_WITH(doc-dir, [ --with-doc-dir=dir directory in which to install documents], AC_SUBST(DOC_DIR,$withval), AC_SUBST(DOC_DIR,"$datadir/doc/grap")) AC_SUBST(INSTALL_DOCS) dnl Checks for libraries. dnl Checks for header files. # Autoupdate added the next two lines to ensure that your configure # script's behavior did not change. They are probably safe to remove. AC_DEFINE(STDC_HEADERS) AC_CHECK_INCLUDES_DEFAULT AC_PROG_EGREP AC_CHECK_HEADERS(unistd.h errno.h limits) AC_CHECK_HEADERS(unordered_map hash_map ext/hash_map) AC_DEFINE(HASH_SPACE,std,[Namespace for hash maps]) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T dnl Checks for library functions. TVF_FUNC_DECL(snprintf,stdio.h) TVF_FUNC_DECL(strdup, stdio.h string.h,REPLACE) TVF_FUNC_DECL(strerror, stdio.h string.h,REPLACE) dnl Autoconf believes these are always available AC_DEFINE(HAVE_RANDOM) AC_DEFINE(RANDOM_DECLARED) TVF_DECL_OPTARG if test "$ac_cv_func_snprintf" = "no"; then AC_CACHE_CHECK(if sprintf returns an int, grap_cv_sprintf_int, AC_RUN_IFELSE([AC_LANG_SOURCE([[ changequote(<<, >>)dnl #include int main(int argc, char **argv) { char a<<[10]>>; if ( (char *) sprintf(a,"ten") == a ) return 1; else return 0; } changequote([, ])dnl ]])],[grap_cv_sprintf_int="yes"],[grap_cv_sprintf_int="no"],[echo ""])) if test "$grap_cv_sprintf_int" = "no" ; then AC_DEFINE(SPRINTF_NOT_INT) fi fi test "x$prefix" = xNONE && prefix="$ac_default_prefix" # expand the data directory parameter. Repeatedly eval the contents # of ddir until it has no $ in it. ddir=$datadir while echo $ddir | grep '\$' > /dev/null ; do ddir=`eval echo $ddir` done AC_DEFINE_UNQUOTED(DEFINES,"${ddir}/grap/grap.defines") # expand the examples directory parameter. Repeatedly eval the contents # of ddir until it has no $ in it. ddir=$EXAMPLE_DIR while echo $ddir | grep '\$' > /dev/null ; do ddir=`eval echo $ddir` done AC_DEFINE_UNQUOTED(EXAMPLES_DIR,"${ddir}") # expand the data directory parameter. Repeatedly eval the contents # of ddir until it has no $ in it. ddir=$DOC_DIR while echo $ddir | grep '\$' > /dev/null ; do ddir=`eval echo $ddir` done AC_DEFINE_UNQUOTED(DOCS_DIR,"${ddir}") dnl if the caller has overridden the decision on suppressing dnl optimization, use their decision, otherwise optimization has already dnl been suppressed above AC_MSG_CHECKING(whether to optimize grap_tokenizer) AC_ARG_ENABLE(optimize-grap_tokenizer, [ --enable-optimize-grap_tokenizer do not prevent optimization of the grap_tokenize.cc file], ac_cv_grap_opt_tok="yes", AC_CACHE_VAL(ac_cv_grap_opt_tok, ac_cv_grap_opt_tok="no")) AC_MSG_RESULT($ac_cv_grap_opt_tok) if test "$ac_cv_grap_opt_tok" = "yes" ; then SUPPRESS_OPT="" fi AC_MSG_CHECKING(whether configure called from a FreeBSD port) AC_ARG_WITH(freebsd-ports, [ --with-freebsd-ports configure called by a FreeBSD ports makefile], ac_cv_grap_opt_port="yes", AC_CACHE_VAL(ac_cv_grap_opt_port, ac_cv_grap_opt_port="no")) AC_MSG_RESULT($ac_cv_grap_opt_port) if test $ac_cv_grap_opt_port = "no" ; then INSTALL_DEPS="all grap.defines grap.1 install-docs" else INSTALL_DEPS="all grap.defines grap.1" fi AC_SUBST(INSTALL_DEPS) AC_MSG_CHECKING(whether to force safer mode) AC_ARG_WITH(safer-mode, [ --with-safer-mode disable sprintf to avoid attacks], ac_cv_grap_safer_mode="yes", AC_CACHE_VAL(ac_cv_grap_safer_mode, ac_cv_grap_safer_mode="no")) AC_MSG_RESULT($ac_cv_grap_safer_mode) if test $ac_cv_grap_safer_mode = "yes" ; then AC_DEFINE(GRAP_SAFER) fi GRAPLIBOBJS=$LIBOBJS AC_SUBST(GRAPLIBOBJS) AC_CONFIG_FILES([Makefile]) AC_OUTPUT grap-1.49/config.h.in0000664000175000017500000000644515000074642011355 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* The pathname of the grap.defines file */ #undef DEFINES /* The directory for documentation */ #undef DOCS_DIR /* The directory for examples */ #undef EXAMPLES_DIR /* True if the grap sprintf command is disabled */ #undef GRAP_SAFER /* Namespace for hash maps */ #undef HASH_SPACE /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_EXT_HASH_MAP /* Define to 1 if you have the header file. */ #undef HAVE_HASH_MAP /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS /* Define to 1 if you have the random function */ #undef HAVE_RANDOM /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UNORDERED_MAP /* True if optarg is defined by headers */ #undef OPTARG_DEFINED /* OS version */ #undef OS_VERSION /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* True if random() is declared */ #undef RANDOM_DECLARED /* True if random() is declared in math.h */ #undef RANDOM_IN_MATH /* True if rand() is declared */ #undef RAND_DECLARED /* True if rand() is declared in math.h */ #undef RAND_IN_MATH /* Is snprintf declared? */ #undef SNPRINTF_DECLARED /* True if sprintf does not return an integer */ #undef SPRINTF_NOT_INT /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* True if strdup is declared */ #undef STRDUP_DECLARED /* True if strerror is declared */ #undef STRERROR_DECLARED /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to `unsigned int' if does not define. */ #undef size_t grap-1.49/grap_data.h0000664000175000017500000000703514546364223011434 00000000000000//-*-c++-*- #ifndef GRAP_DATA_H #define GRAP_DATA_H // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. #ifdef STDC_HEADERS #include #endif #include #include #include inline void unquote(string *s) { int i; if ( (*s)[0] == '"' ) s->erase(0,1); i = s->length()-1; if ( (*s)[i] == '"' ) s->erase(i,1); } inline void quote(string *s) { s->insert((string::size_type) 0,1,'"'); s->append(1,'"'); } class macro { public: int next_arg; // the index into the next argument string *text; // the text of the macro vector arg; // The current argument values string *name; // the name of the macro if it's in a // dictionary. macro(string *t=0, string *n =0) : next_arg(0), text(t), arg(), name(n) { } ~macro() { delete text; text = 0; delete name; name = 0; while ( !arg.empty() ) { string *d = arg.back(); arg.pop_back(); delete d; } } int add_arg(string *s ) { arg.push_back(s); return 1; } string *invoke() { string *s = new string; // The expanded macro int argn =0; // the number of the arg to interpolate int dig; // Number of digits seen after this $ int i=0; // the current character offset const int lim=text->length();// number of characters to check while (i < lim ) { switch ((*text)[i] ) { default: *s += (*text)[i++]; break; case '$': dig = 0; i++; while (isdigit((*text)[i])) { argn *= 10; argn += (*text)[i] - 0x30; i++; dig++; } if ( argn > 0 && argn <= (int) arg.size() ) { if ( arg[argn-1] ) *s += *(arg[argn-1]); } argn = 0; // If there was no digit after the $ leave the $ // untouched and leave i as the offset of the // character immediately following the $ if ( !dig ) { *s += '$'; } break; } } next_arg = 0; while ( !arg.empty() ) { string *d = arg.back(); arg.pop_back(); delete d; } return s; } }; class copydesc { public: typedef enum { fname, until} type; type t; string *s; copydesc() : t(fname), s(0) {} ~copydesc() { if ( s ) { delete s; s = 0; } } }; // encapsulate the information about the simple keyword tokens. class keyword { public: vector add; // make these keywords active vector remove; // make these keywords inactive bool clear; // clear the active keyword list if this true int token; // the lex token that corresponds to this // string. keyword() : add(), remove(), clear(false), token(0) { } keyword(const keyword& k) : add(k.add), remove(k.remove), clear(k.clear), token(k.token) { } keyword(const vector& a, const vector& r, bool cl, int t) : add(a), remove(r), clear(cl), token(t) { } template keyword(I1 sa, I1 ea, I2 sr, I2 er, bool cl, int t) : add(sa, ea), remove(sr, er), clear(cl), token(t) { } keyword& operator=(const keyword& k) { add = k.add; remove = k.remove; clear = k.clear; token = k.token; return *this; } }; // we use this to make yacc happier typedef pair coordid; // bar parameter types class bar_param { public: double x; double ht; double wid; double base; bool have_x; bool have_ht; bar_param() : x(0.0), ht(0.0), wid(1.0), base(0.0), have_x(false), have_ht(false) { } }; #endif grap-1.49/grap.doc0000664000175000017500000010613214546364223010757 00000000000000.\"-*-nroff-*- .\" This file is (c) 1998-2006 Ted Faber (faber@lunabase.org) see .\" COPYRIGHT for the full copyright and limitations of liabilities. .Dd March 11, 2006 .Os .Dt GRAP 1 .Sh NAME .Nm grap .Nd Kernighan and Bentley's language for typesetting graphs .Sh SYNOPSIS .Nm .Op Fl d Ar defines_file .Op Fl D .Op Fl l .Op Fl M Ar include path .Op Fl R .Op Fl r .Op Fl v .Op Fl u .Op Fl C .Op Fl c .Op Fl h .Op Ar filename ... .Sh DESCRIPTION .Nm is an implementation of Kernighan and Bentley's language for typesetting graphs, as described in ``Grap-A Language for Typesetting Graphs, Tutorial and User Manual,'' by Jon L. Bentley and Brian W. Kernighan, revised May 1991, which is the primary source for information on how to use .Nm grap . As of this writing, it is available electronically at .Li http://www.kohala.com/start/troff/cstr114.ps . Additional documentation and examples, packaged with .Nm , may have been installed locally as well. If available, paths to them can be displayed using .Nm .Fl h or .Nm .Fl v (or .Nm .Fl -help / .Nm .Fl -version ) .Pp This version is a black box implementation of .Nm grap , and some inconsistencies are to be expected. The remainder of this manual page will briefly outline the .Nm language as implemented here. .Pp .Nm is a .Xr pic 1 pre-processor. It takes commands embedded in a .Xr troff 1 source file which are surrounded by .Ic .G1 and .Ic .G2 macros, and rewrites them into .Xr pic commands to display the graph. Other lines are copied. Output is always to the standard output, which is usually redirected. Input is from the given .Ar filename Ns No s , which are read in order. A .Ar filename of .Fl is the standard input. If no .Ar filename Ns No s are given, input is read from the standard input. .Pp Because .Nm is a .Xr pic preprocessor, and GNU .Xr pic will output TeX, it is possible to use .Nm with TeX. .Pp The .Fl d option specifies a file of macro definitions to be read at startup, and defaults to /usr/local/share/grap/grap.defines . The .Fl D option inhibits the reading of any initial macros file (the .Fl l flag is a synonym for .Fl D , though I do not remember why). The defines file can also be given using the .Ev GRAP_DEFINES environment variable. (See below). .Pp .Fl v prints the version information on the standard output and exits. .Fl -version is a synonym for .Fl v . .Pp .Fl u makes labels unaligned by default. This version of .Nm uses new features of GNU .Xr pic to align the left and right labels with the axes, that is that the left and right labels run at right angles to the text of the paper. This may be useful in porting old .Nm programs. .Fl c makes plot strings unclipped by default. Some versions of .Nm allow users to place a string anywhere in the coordinate space, rather than only in the frame. By default this version of .Nm does not plot any string centered outside the frame. .Fl c allows strings to be placed anywhere. See also the .Ic clipped and .Ic unclipped string modifiers described in the .Ic plot statement. .Pp .Fl M is followed by a colon-separated list of directories used to search for relative pathnames included via .Ic copy . The path is also used to locate the defines file, so if the .Fl d changes the defines file name to a relative name, it will be searched for in the path given by .Fl M . The search path always includes the current directory, and by default that directory is searched last. .Pp All numbers used internally by .Nm are double precision floating point values. Sometimes using floating point numbers has unintended consequences. To help avoid these problems, .Nm can use two thresholds for comparison of floating point numbers, set by .Fl R or .Fl r . The .Fl R flag sets coarse comparison mode, which is suitable for most applications. If you are plotting small values \(en less than 1e-6 or so \(en consider using .Fl r which uses very fine comparisons between numbers. You may also want to rescale your plotted values to be larger in magnitude. The coarse comparisons are used by default. .Pp To be precise, the value by which two numbers must differ for .Nm to consider them not equal is called the comparison limit and the smallest non-zero number is called the minimum value. The values a given version of .Nm uses for these are included in the output of .Fl v or .Fl h . .Pp All .Nm commands are included between .Ic .G1 and .Ic .G2 macros, which are consumed by .Nm grap . The output contains .Xr pic between .Ic .PS and .Ic .PE macros. Any arguments to the .Ic .G1 macro in the input are arguments to the .Ic .PS macro in the output, so graphs can be scaled just like .Xr pic diagrams. If .Fl C is given, any macro beginning with \&.G1 or \&.G2 is treated as a \&.G1 or \&.G2 macro, for compatibility with old versions of troff. Using .Fl C also forces pure troff syntax on embedded font change commands when strings have the .Ic size attribute, and all strings to be .Ic unclipped . .Pp The .Fl h flag prints a brief help message and exits. .Fl -help is a synonym for .Fl h . .Pp It is possible for someone to cause .Nm to fail by passing a bad format string and data to the .Ic sprintf command. If .Nm is integrated as part of the printing system, this could conceivably provided a path to breaching security on the machine. If you choose to use .Nm as part of a printing system run by the super-user, you should disable .Ic sprintf commands. This can be done by calling .Nm with the .Fl S flag, setting the .Ev GRAP_SAFER environment variable, or compiling with the GRAP_SAFER preprocessor symbol defined. (The GNU configure script included with .Nm will define that preprocessor symbol if the .Fl -with-grap-safe option is given.) .Pp The .Nm commands are sketched below. Refer to Kernighan and Bentley's paper for the details. .Pp New versions of .Xr groff 1 will invoke .Nm if .Fl G is given. .Ss Commands .Pp Commands are separated from one another by newlines or semicolons (;). .Pp .Ic frame .Op Ar line_description .Oo .Bk -words .Cm ht Ar height No \(or Cm wid Ar width .Ek .Oc .Oo .Bk -words .Oo .Sm off .Cm ( top No \(or Cm bottom No \(or .Cm left No \(or .Sm on .Cm right ) .Ar line_description .Ek .Oc \&... .Oc .sp .Ic frame .Oo .Bk -words .Cm ht Ar height No \(or Cm wid Ar width .Ek .Oc .Op Ar line_description .Oo .Bk -words .Oo .Sm off .Cm ( top No \(or Cm bottom No \(or .Cm left No \(or .Sm on .Cm right ) .Ar line_description .Ek .Oc \&... .Oc .Bd -filled -offset indent This describes how the axes for the graph are drawn. A .Ar line_description is a .Xr pic line description, e.g., .Li dashed .Li 0.5 , or the literal .Li solid . It may also include a .Ic color keyword followed by the color to draw the string in double quotes. Any color understood by the underlying groff system can be used. Color can only be used under GNU pic, and is not available in compatibility mode. Similarly, for pic implementations that understand .Ic thickness , that attribute may be used with a real valued parameter. .Ic Thickness is not available in compatibility mode. .Pp If the first .Ar line_description is given, the frame is drawn with that style. The default is .Li solid . The height and width of the frame can also be specified in inches. The default line style can be over-ridden for sides of the frame by specifying additional parameters to .Ic frame . .Pp If no plotting commands have been given before the .Ic frame command is issued, the frame will be output at that point in the plotting stream relative to embedded .Xr troff or .Xr pic commands. Otherwise the frame is output before the first plotted object (even invisible ones). .Pp .Ic ht and .Ic wid are in inches by default, but can be any .Xr groff unit. If omitted, the dimensions are 2 inches high by 3 inches wide. .Ed .Pp .Ic coord .Op Ar name .Op Cm x Ar expr , expr .Op Cm y Ar expr , expr .Oo .Cm log x No \(or .Cm log y No \(or .Cm log log .Oc .Bd -filled -offset indent The .Ic coord command specifies a new coordinate system or sets limits on the default system. It defines the largest and smallest values that can be plotted, and therefore the scale of the data in the frame. The limits for the x and y coordinate systems can be given separately. If a .Ar name is given, that coordinate system is defined, if not the default system is modified. .Pp A coordinate system created by one .Ic coord command may be modified by subsequent .Ic coord commands. A .Nm program may declare a coordinate space using .Ic coord , .Ic copy a file of data through a macro that plots the data and finds its maxima and minima, and then define the size of the coordinate system with a second .Ic coord statement. .Pp This command also determines if a scale is plotted logarithmically. .Cm log log means the same thing as .Cm log x log y . .Ed .Pp .Ic draw .Op Ar line_name .Op Ar line_description .Op Ar plot_string .Bd -filled -offset indent The .Ic draw command defines the style with which a given line will be plotted. If .Ar line_name is given, the style is associated with that name, otherwise the default style is set. .Ar line_description is a .Xr pic line description, and the optional .Ar plot_string is a string to be centered at each point. The default line description is .Li invis , and the default plotting string is a centered bullet, so by default each point is a filled circle, and they are unconnected. If points are being connected, each .Ic draw command ends any current line and begins a new one. .Pp When defining a line style, that is the first .Ic draw command for a given line name, specifying no plot string means that there are to be no plot strings. Omitting the plot string on subsequent .Ic draw commands addressing the same named line means not to change the plot string. If a line has been defined with a plot string, and the format is changed by a subsequent .Ic draw statement, the plot string can be removed by specifying "" in the .Ic draw statement. .Pp The plot string can have its format changed through several string_modifiers. String_modifiers are described in the description of the .Ic plot command. .Pp The standard defines file includes several macros useful as plot strings, including .Ic bullet , .Ic square , and .Ic delta . .Pp .Ic new is a synonym for .Ic draw . .Ed .Pp .Ic next .Op Ar line_name .Cm at .Op Ar coordinates_name .Ar expr , expr .Op Ar line_description .Bd -filled -offset indent The .Ic next command plots the given point using the line style given by .Ar line_name , or the default if none is given. If .Ar line_name is given, it should have been defined by an earlier .Ic draw command, if not a new line style with that name is created, initialized the same way as the default style. The two expressions give the point's x and y values, relative to the optional coordinate system. That system should have been defined by an earlier .Ic coord command, if not, grap will exit. If the optional .Ar line_description is given, it overrides the style's default line description. You cannot over-ride the plotting string. To use a different plotting string use the .Ic plot command. .Pp The coordinates may optionally be enclosed in parentheses: .Ar ( expr , expr ) .Ed .Pp .Ar quoted_string .Op Ar string_modifiers .Oo .No , Ar quoted_string .Oo .Ar string_modifiers .Oc .Oc \&... .Cm at .Op Ar coordinates_name .Ar expr , expr .Pp .Ic plot .Ar expr .Op Ar format_string .Cm at .Op Ar coordinates_name .Ar expr , expr .Bd -filled -offset indent These commands both plot a string at the given point. In the first case the literal strings are stacked above each other. The string_modifiers include the .Xr pic justification modifiers .Ns No ( Ic ljust , .Ic rjust , .Ic above , and .Ic below Ns No ), and absolute and relative .Li size modifiers. See the .Xr pic documentation for the description of the justification modifiers. .Nm also supports the .Ic aligned and .Ic unaligned modifiers which are briefly noted in the description of the .Ic label command. .Pp The standard defines file includes several macros useful as plot strings, including .Ic bullet , .Ic square , and .Ic delta . .Pp Strings placed by either format of the .Ic plot command are restricted to being within the frame. This can be overridden by using the .Ic unclipped attribute, which allows a string to be plotted in or out of the frame. The .Fl c and .Fl C flags set .Ic unclipped on all strings, and to prevent a string from being plotted outside the frame when those flags are active, the .Ic clipped attribute can be used to restore clipping behavior. Though .Ic clipped or .Ic unclipped can be applied to any string, it only has meaning for .Ic plot statements. .Pp .Li size .Ar expr sets the string size to .Ar expr points. If .Ar expr is preceded by a + or -, the size is increased or decreased by that many points. .Pp If .Ic color and a color name in double quotes appears, the string will be rendered in that color under a version of GNU troff that supports color. Color is not available in compatibility mode. .Pp In the second version, the .Ar expr is converted to a string and placed on the graph. .Ar format_string is a .Xr printf 3 format string. Only formatting escapes for printing floating point numbers make sense. The format string is only respected if the .Ic sprintf command is also active. See the description of .Ic sprintf for the various ways to disable it. .Ic Plot and .Ic sprintf respond differently when .Nm is running safely. .Ic Sprintf ignores any arguments, passing the format string through without substitution. .Ic plot ignores the format string completely, plotting .Ar expr using the .Qq %g format. .Pp Points are specified the same way as for .Ic next commands, with the same consequences for undefined coordinate systems. .Pp The second form of this command is because the first form can be used with a .Nm .Ic sprintf expression (See .Sx Expressions ) . .Ed .Pp .Ic ticks .Sm off .Xo ( Cm left No \(or Cm right .No \(or Cm top No \(or Cm bottom ) .Xc .Oo .Sm on .Xo ( Cm in Ns No \(or Ns Cm out ) .Xc .Op Ar expr .Oc .Sm off .Oo .Cm on \(or Cm auto .Sm on .Ar coord_name .Oc .Pp .Ic ticks .Sm off .Xo ( Cm left No \(or Cm right No \(or Cm top No \(or Cm bottom ) .Xc .Sm on .Xo ( Cm in Ns No \(or Ns Cm out ) .Xc .Op Ar expr .Oo .Cm up Ar expr No \(or .Cm down Ar expr No \(or .Cm left Ar expr No \(or .Cm right Ar expr .Oc .Cm at .Op Ar coord_name .Ar expr .Op Ar format_string .Oo .Oo .No , Ar expr .Oo .Ar format_string .Oc .Oc .No ... .Oc .Pp .Ic ticks .Sm off .Xo ( Cm left No \(or Cm right .No \(or Cm top No \(or Cm bottom ) .Xc .Sm on .Xo ( Cm in Ns No \(or Ns Cm out ) .Xc .Op Ar expr .Oo .Cm up Ar expr No \(or .Cm down Ar expr No \(or .Cm left Ar expr No \(or .Cm right Ar expr .Oc .Cm from .Op coord_name .Ar start_expr .Cm to .Ar end_expr .Oo .Cm by .Sm off .Oo .No + \(or - \(or * \(or / .Sm on .Oc .Ar by_expr .Oc .Op format_string .Pp .Ic ticks .Sm off .Oo .Cm left Xo No \(or Cm right .No \(or Cm top No \(or Cm bottom .Oc .Xc .Sm on .Cm off .Bd -filled -offset indent This command controls the placement of ticks on the frame. By default, ticks are automatically generated on the left and bottom sides of the frame. .Pp The first version of this command turns on the automatic tick generation for a given side. The .Cm in or .Cm out parameter controls the direction and length of the ticks. If a .Ar coord_name is specified, the ticks are automatically generated using that coordinate system. If no system is specified, the default coordinate system is used. As with .Ic next and .Ic plot , the coordinate system must be declared before the .Ic ticks statement that references it. This syntax for requesting automatically generated ticks is an extension, and will not port to older .Nm implementations. .Pp The second version of the .Ic ticks command overrides the automatic placement of the ticks by specifying a list of coordinates at which to place the ticks. If the ticks are not defined with respect to the default coordinate system, the .Ar coord_name parameter must be given. For each tick a .Xr printf 3 style format string can be given. The .Ar format_string defaults to .Qq %g . The format string can also take string modifiers as described in the .Ic plot command. To place ticks with no labels, specify .Ar format_string as .Qq \& . .Pp If .Ic sprintf is disabled, .Ic ticks behaves as .Ic plot with respect to the format string. .Pp The labels on the ticks may be shifted by specifying a direction and the distance in inches to offset the label. That is the optional direction and expression immediately preceding the .Cm at . .Pp The third format of the .Ic ticks command over-rides the default tick generation with a set of ticks ar regular intervals. The syntax is reminiscent of programming language for loops. Ticks are placed starting at .Ar start_expr ending at .Ar end_expr one unit apart. If the .Cm by clause is specified, ticks are .Ar by_expr units apart. If an operator appears before .Ar by_expr each tick is operated on by that operator instead of +. For example .Bd -literal -offset indent-two ticks left out from 2 to 32 by *2 .Ed .Pp will put ticks at 2, 4, 8, 16, and 32. If .Ar format_string is specified, all ticks are formatted using it. .Pp The parameters preceding the .Cm from act as described above. .Pp The .Cm at and .Cm for forms of tick command may both be issued on the same side of a frame. For example: .Bd -literal -offset indent-two ticks left out from 2 to 32 by *2 ticks left in 3, 5, 7 .Ed .Pp will put ticks on the left side of the frame pointing out at 2, 4, 8, 16, and 32 and in at 3, 5, and 7. .Pp The final form of .Ic ticks turns off ticks on a given side. If no side is given the ticks for all sides are cancelled. .Pp .Ic tick is a synonym for .Ic ticks . .Ed .Pp .Ic grid .Sm off .Xo ( Cm left No \(or Cm right .No \(or Cm top No \(or Cm bottom ) .Xc .Sm on .Op Li ticks off .Op Ar line_description .Oo .Cm up Ar expr No \(or .Cm down Ar expr No \(or .Cm left Ar expr No \(or .Cm right Ar expr .Oc .Oo .Sm off .Cm on \(or Cm auto .Sm on .Op Ar coord_name .Oc .Pp .Ic grid .Sm off .Xo ( Cm left No \(or Cm right .No \(or Cm top No \(or Cm bottom ) .Xc .Sm on .Op Li ticks off .Op Ar line_description .Oo .Cm up Ar expr No \(or .Cm down Ar expr No \(or .Cm left Ar expr No \(or .Cm right Ar expr .Oc .Cm at .Op Ar coord_name .Ar expr .Op Ar format_string .Oo .Oo .No , Ar expr .Oo .Ar format_string .Oc .Oc .No ... .Oc .Pp .Ic grid .Sm off .Xo ( Cm left No \(or Cm right .No \(or Cm top No \(or Cm bottom ) .Xc .Sm on .Op Li ticks off .Op Ar line_description .Oo .Cm up Ar expr No \(or .Cm down Ar expr No \(or .Cm left Ar expr No \(or .Cm right Ar expr .Oc .Cm from .Op coord_name .Ar start_expr .Cm to .Ar end_expr .Oo .Cm by .Sm off .Oo .No + \(or - \(or * \(or / .Sm on .Oc .Ar by_expr .Oc .Op format_string .Bd -filled -offset indent The .Ic grid command is similar to the .Ic ticks command except that .Ic grid specifies the placement of lines in the frame. The syntax is similar to .Ic ticks as well. .Pp By specifying .Li ticks off in the command, no ticks are drawn on that side of the frame. If ticks appear on a side by default, or have been declared by an earlier .Ic ticks command, .Ic grid does not cancel them unless .Li ticks off is specified. .Pp Instead of a direction for ticks, .Ic grid allows the user to pick a line description for the grid lines. The usual .Xr pic line descriptions are allowed. .Pp Grids are labelled by default. To omit labels, specify the format string as .Qq \& . .Pp If .Ic sprintf is disabled, .Ic grid behaves as .Ic plot with respect to the format string. .Ed .Pp .Ic label .Sm off .Xo ( Cm left No \(or Cm right .No \(or Cm top No \(or Cm bottom ) .Xc .Sm on .Ar quoted_string .Op Ar string_modifiers .Oo .No , Ar quoted_string .Oo .Ar string_modifiers .Oc .Oc \&... .Oo .Cm up Ar expr No \(or .Cm down Ar expr No \(or .Cm left Ar expr No \(or .Cm right Ar expr .Oc .Bd -filled -offset indent The .Ic label command places a label on the given axis. It is possible to specify several labels, which will be stacked over each other as in .Xr pic . The final argument, if present, specifies how many inches the label is shifted from the axis. .Pp By default the labels on the left and right labels run parallel to the frame. You can cancel this by specifying .Li unaligned as a .Ar string_modifier . .Ed .Pp .Ic circle .Cm at .Op Ar coordinate_name .Ar expr , expr .Op Cm radius Ar expr .Op Ar linedesc .Bd -filled -offset indent This draws an circle at the point indicated. By default, the circle is small, 0.025 inches. This can be over-ridden by specifying a radius. The coordinates of the point are relative to the named coordinate system, or the default system if none is specified. .Pp This command has been extended to take a line description, e.g., .Li dotted . It also accepts the filling extensions described below in the .Ic bar command. It will also accept a .Ic color keyword that gives the color of the outline of the circle in double quotes and a .Ic fillcolor command that sets the color to fill the circle with similarly. Colors are only available when compatibility mode is off, and using a version of GNU pic that supports color. .Ed .Pp .Ic line .Op Ar line_description .Cm from .Op Ar coordinate_name .Ar expr , expr .Cm to .Op Ar coordinate_name .Ar expr , expr .Op Ar line_description .Pp .Ic arrow .Op Ar line_description .Cm from .Op Ar coordinate_name .Ar expr , expr .Cm to .Op Ar coordinate_name .Ar expr , expr .Op Ar line_description .Bd -filled -offset indent This draws a line or arrow from the first point to the second using the given style. The default line style is .Li solid . The .Ar line_description can be given either before the .Cm from or after the .Cm to clause. If both are given the second is used. It is possible to specify one point in one coordinate system and one in another, note that if both points are in a named coordinate system (even if they are in the same named coordinate system), both points must have .Ar coordinate_name given. .Ed .Pp .Pp .Ic copy .Op Qq Ar filename .Op Cm until Qq Ar string .Op Cm thru Ar macro .Bd -filled -offset indent The .Ic copy command imports data from another file into the current graph. The form with only a filename given is a simple file inclusion; the included file is simply read into the input stream and can contain arbitrary .Nm commands. The more common case is that it is a number list; see .Sx Number Lists below. .Pp The second form takes lines from the file, splits them into words delimited by one or more spaces, and calls the given macro with those words as parameters. The macro may either be defined here, or be a macro defined earlier. See .Sx Macros for more information on macros. .Pp The .Ar filename may be omitted if the .Cm until clause is present. If so the current file is treated as the input file until .Ar string is encountered at the beginning of the line. .Pp .Ic copy is one of the workhorses of .Nm grap . Check out the paper and .Pa /usr/local/share/examples/grap for more details. Confirm the location of the examples directory using the .Fl v flag. .Ed .Ic print .Sm off .Ar ( expr \(or string ) .Sm on .Bd -filled -offset indent Prints its argument to the standard error. .Ed .Pp .Ic sh Ar block .Bd -filled -offset indent This passes .Ar block to .Xr sh 1 . Unlike K&B .Nm no macro or variable expansion is done. I believe that this is also true for GNU .Xr pic version 1.10. See the .Sx Macros section for information on defining blocks. .Ed .Pp .Ic pic Ar pic_statement .Bd -filled -offset indent This issues the given .Xr pic statements in the enclosing .Ic .PS and .Ic .PE at the point where the command is issued. .Pp Statements that begin with a period are considered to be .Xr troff statements and are output in the enclosing .Ic .PS and .Ic .PE at the point where the command appears. .Pp For the purposes of relative placement of .Xr pic or .Xr troff commands, the frame is output immediately before the first plotted object, or the .Ic frame statement, if any. If the user specifies .Xr pic or .Xr troff commands and neither any plottable object nor a .Ic frame command, the commands will not be output. .Ed .Pp .Ic graph Ar Name pic_commands .Bd -filled -offset indent This command is used to position graphs with respect to each other. The current graph is given the .Xr pic name .Ar Name (names used by .Xr pic begin with capital letters). Any .Xr pic commands following the graph are used to position the next graph. The frame of the graph is available for use with .Xr pic name .Li Frame. The following places a second graph below the first: .Bd -literal -offset indent-two graph Linear [ graph description ] graph Exponential with .Frame.n at \\ Linear.Frame.s - (0, .05) [ graph description ] .Ed .Ed .Pp .Ar name = expr .Bd -filled -offset indent This assigns .Ar expr to the variable .Ar name . .Nm has only numeric (double) variables. .Pp Assignment creates a variable if it does not exist. Variables persist across graphs. Assignments can cascade; .Li a = b = 35 assigns 35 to .Li a and .Li b . .Ed .Pp .Ic bar .Sm off .No ( Cm up No \(or Cm right ) .Sm on .Op Ar coordinates_name .Ar offset .Cm ht .Ar height .Op Cm wid Ar width .Op Cm base Ar base_offset .Op Ar line_description .Pp .Ic bar .Op Ar coordinates_name .Ar expr , expr , .Op Ar coordinates_name .Ar expr , expr , .Op Ar line_description .Bd -filled -offset indent The .Ic bar command facilitates drawing bar graphs. The first form of the command describes the bar somewhat generally and has .Nm place it. The bar may extend up or to the right, is centered on .Ar offset and extends up or right .Ar height units (in the given coordinate system). For example .Bd -literal -offset indent-two bar up 3 ht 2 .Ed .Pp draws a 2 unit high bar sitting on the x axis, centered on x=3. By default bars are 1 unit wide, but this can be changed with the .Ic wid keyword. By default bars sit on the base axis, i.e., bars directed up will extend from y=0. That may be overridden by the .Ic base keyword. (The bar described above has corners (2.5, 0) and (3.5, 2).) .Pp The line description has been extended to include a .Ic fill Ar expr keyword that specifies the shading inside the bar. Bars may be drawn in any line style. They support the .Ic color and .Ic fillcolor keywords described under .Ic circle . .Pp The second form of the command draws a box with the two points as corners. This can be used to draw boxes highlighting certain data as well as bar graphs. Note that filled bars will cover data drawn under them. .Ed .Ss Control Flow .Pp .Ic if Ar expr Ic then Ar block .Op Ic else Ar block .Bd -filled -offset indent The .Ic if statement provides simple conditional execution. If .Ar expr is non-zero, the .Ar block after the .Ic then statement is executed. If not the .Ar block after the .Ic else is executed, if present. See .Sx Macros for the definition of blocks. Early versions of this implementation of .Nm treated the blocks as macros that were defined and expanded in place. This led to unnecessary confusion because explicit separators were sometimes called for. Now, .Nm inserts a separator (;) after the last character in .Ar block , so constructs like .Bd -literal if (x == 3) { y = y + 1 } x = x + 1 .Ed behave as expected. A separator is also appended to the end of a .Ic for block. .Ed .Pp .Ic for Ar name Ic from Ar from_expr Ic to Ar to_expr .Oo .Ic by .Op No +\(or-\(or*\(or/ .Ar by_expr .Oc .Ic do .Ar block .Bd -filled -offset indent This command executes .Ar block iteratively. The variable .Ar name is set to .Ar from_expr and incremented by .Ar by_expr until it exceeds .Ar to_expr . The iteration has the semantics defined in the .Ic ticks command. The definition of .Ar block is discussed in .Sx Macros . See also the note about implicit separators in the description of the .Ic if command. .Pp An .Ic = can be used in place of .Ic from . .Ed .Ss Expressions .Pp .Nm supports most standard arithmetic operators: + - / * ^. The carat (^) is exponentiation. In an .Ic if statement .Nm also supports the C logical operators ==, !=, &&, || and unary !. Also in an .Ic if , == and != are overloaded for the comparison of quoted strings. Parentheses are used for grouping. .Pp Assignment is not allowed in an expression in any context, except for simple cascading of assignments. .Li a = b = 35 works as expected; .Li a = 3.5 * (b = 10) does not execute. .Pp .Nm supports the following functions that take one argument: .Ic log , exp , int , sin , cos , sqrt , rand , floor , ceil . The logarithms are base 10 and the trigonometric functions are in radians. .Ic eexp returns Euler's number to the given power and .Ic ln returns the natural logarithm. The natural log, exponentiation functions and floor and ceil are extensions and are probably not available in other .Nm implementations. .Pp .Ic rand returns a random number uniformly distributed on [0,1). The following two-argument functions are supported: .Ic atan2 , min , max . .Ic atan2 works just like .Xr atan2 3 . The random number generator can be seeded by calling .Ic srand with a single parameter (converted internally to an integer). Because its return value is of no use, you must use .Ic srand as a separate statement, it is not part of a valid expression. .Ic srand is not portable. .Pp The .Ic getpid function takes no arguments and returns the process id. This may be used to seed the random number generator, but do not expect cryptographically random values to result. .Pp Other than string comparison, no expressions can use strings. One string valued function exists: .Ic sprintf ( Ar format , .Oo .Ar expr .Op Ar \&, expr .Oc ). It operates like .Xr sprintf 3 , except returning the value. It can be used anywhere a quoted string is used. If .Nm is run with .Fl S , the environment variable .Ev GRAP_SAFER is defined, or .Nm has been compiled for safer operation, the .Ic sprintf command will return the format string. This mode of operation is only intended to be used only if .Nm is being used as part of a super-user enabled print system. .Pp .Nm version 1.44 and beyond support two functions for date and time manipulation, .Ic strptime and .Ic strptime . .Ic strptime parses a time using the .Xr strptime 3 function. It takes two parameters, both strings, the format and a string to parse using that format and returns a number that can be sorted directly - the number of seconds since the UNIX epoch. .Ic strftime does the reverse. It takes a string and a number and formats the number into a date. In both functions, the format is the first parameter. The formats are defined in the documentation for .Xr strftime 3 . .Ss Macros .Nm has a simple but powerful macro facility. Macros are defined using the .Ic define command : .Pp .Ic define Ar name block .br .Ic undefine Ar name .Bd -filled -offset indent Every occurrence of .Ar name in the program text is replaced by the contents of .Ar block . .Ar block is defined by a series of statements in nested { }'s, or a series of statements surrounded by the same letter. An example of the latter is .Bd -literal -offset indent-two define foo X coord x 1,3 X .Ed Each time .Li foo appears in the text, it will be replaced by .Li coord x 1,3 . Macros are literal, and can contain newlines. If a macro does not span multiple lines, it should end in a semicolon to avoid parsing errors. .Pp Macros can take parameters, too. If a macro call is followed by a parenthesized, comma-separated list the values starting with $1 will be replaced in the macro with the elements of the list. A $ not followed by a digit is left unchanged. This parsing is very rudimentary; no nesting or parentheses or escaping of commas is allowed. Also, there is no way to say argument 1 followed by a digit (${1}0 in sh(1)). .Pp The following will draw a line with slope 1. .Bd -literal -offset indent-two define foo { next at $1, $2 } for i from 1 to 5 { foo(i,i) } .Ed Macros persist across graphs. The file .Pa /usr/local/share/grap/grap.defines contains simple macros for plotting common characters. The .Ic undefine command deletes a macro. .Pp See the directory .Pa /usr/local/share/examples/grap for more examples of macros. Confirm the location of the examples directory using the .Fl v flag. .Ed .Ss Number Lists .Pp A whitespace-separated list of numbers is treated specially. The list is taken to be points to be plotted using the default line style on the default coordinate system. If more than two numbers are given, the extra numbers are taken to be additional y values to plot at the first x value. Number lists in DWB .Nm can be comma-separated, and this .Nm supports that as well. More precisely, numbers in number lists can be separated by either whitespace, commas, or both. .Bd -literal -offset indent 1 2 3 4 5 6 .Ed .sp Will plot points using the default line style at (1,2), (1,3),(4,5) and (4,6). A simple way to plot a set of numbers in a file named .Pa ./data is: .Bd -literal -offset indent \&.G1 copy "./data" \&.G2 .Ed .Ss Pic Macros .Pp .Nm defines pic macros that can be used in embedded pic code to place elements in the graph. The macros are .Ic x_gg , .Ic y_gg , and .Ic xy_gg . These macros define pic distances that correspond to the given argument. They can be used to size boxes or to plot pic constructs on the graph. To place a given construct on the graph, you should add Frame.Origin to it. Other coordinate spaces can be used by replacing .Ic gg with the name of the coordinate space. A coordinate space named .Ic gg cannot be reliably accessed by these macros. .Pp The macros are emitted immediately before the frame is drawn. .Pp DWB .Nm may use these as part of its implementation. This .Nm provides them only for compatibility. Note that these are very simple macros, and may not do what you expect under complex conditions. .Sh ENVIRONMENT VARIABLES .Pp If the environment variable .Ev GRAP_DEFINES is defined, .Nm will look for its defines file there. If that value is a relative path name the path specified in the .Fl M option will be searched for it. .Ev GRAP_DEFINES overrides the compiled in location of the defines file, but may be overridden by the .Fl d or .Fl D flags. .Pp If .Ev GRAP_SAFER is set, .Ic sprintf is disabled to prevent forcing .Nm to core dump or smash the stack. .Sh FILES .Pa /usr/local/share/grap/grap.defines .Sh SEE ALSO .Xr atan2 3 , .Xr groff 1 , .Xr pic 1 , .Xr printf 3 , .Xr sh 1 , .Xr sprintf 3 , .Xr troff 1 .Pp If documentation and examples have been installed, .Nm .Fl -version or .Nm .Fl -help will display the locations. .Sh BUGS .Pp There are several small incompatibilities with K&R .Nm grap . They include the .Ic sh command not expanding variables and macros, and a more strict adherence to parameter order in the internal commands. .Pp Although much improved, the error reporting code can still be confused. Notably, an error in a macro is not detected until the macro is used, and it produces unusual output in the error message. .Pp Iterating many times over a macro with no newlines can run .Nm out of memory. .Sh AUTHOR This implementation was done by .An Ted Faber Ao faber@lunabase.org Ac Ns . .An Bruce Lilly Ao bruce.lilly@gmail.com Ac contributed many bug fixes, including a considerable revamp of the error reporting code. If you can actually find an error in your .Nm code, you can probably thank him. .Nm was designed and specified by .An Brian Kernighan and .An Jon Bentley . grap-1.49/Makefile.am0000664000175000017500000000254614546364223011377 00000000000000 # Grap's source files. The dance in nodist_grap_SOURCES and EXTRA_DIST is to # include only the .yy and .ll files without the y.tab.h and generated .cc # files. bin_PROGRAMS = grap grap_SOURCES = grap_draw.cc grap_pic.cc grap_parse.cc grap_tokenizer.cc nodist_grap_SOURCES= grap.yy grap_lex.ll y.tab.h EXTRA_DIST = grap.h grap_data.h grap_draw.h grap_pic.h grap_string.h snprintf.h\ grap.yy grap_lex.ll grap.spec BUILT_SOURCES=y.tab.h # Support for compiling our own strdup and strerror if needed. We don't use # LIBOBJS directly because automake thinks the sources for LIBOBJS are C files. GRAPLIBOBJS=@GRAPLIBOBJS@ grap_LDADD = $(GRAPLIBOBJS) grap_DEPENDENCIES = $(GRAPLIBOBJS) EXTRA_grap_SOURCES= strdup.cc strerror.cc # Delete generated files on clean CLEANFILES = grap.cc grap_lex.cc grap.man y.tab.h # Man page dist_man1_MANS = grap.doc # Where to put grap.defines definesdir = @DEFINES_DIR@ dist_defines_DATA = grap*.defines # Examples exampledir = @EXAMPLE_DIR@ dist_example_DATA = examples/*.d examples/*.result examples/Makefile \ examples/example.ms # Other docs docdir = @DOC_DIR@ dist_doc_DATA = README CHANGES COPYRIGHT grap.man # Configure supplied C++ flags AM_CXXFLAGS = @GXXFLAGS@ @CX0FLAGS@ # Rules for y.tab.h and grap.man y.tab.h: grap.yy ${YACC} -d grap.yy && rm -f y.tab.c grap.man: grap.doc groff -mdoc -Tascii grap.doc > grap.man grap-1.49/grap_tokenizer.cc0000664000175000017500000002372214546364223012674 00000000000000/* This code is (c) 1998-2001 Ted Faber see COPYRIGHT for the full copyright and limitations of liabilities. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef STDC_HEADERS #include #include #include #endif #if defined(STDC_HEADERS) | defined(HAVE_STDLIB_H) #include #endif #include #include #include #include "grap.h" #include "grap_data.h" #include "grap_draw.h" #include "y.tab.h" // Keywords recognized in the initial GRAP state (AT, SPRINTF and all // the string modifiers are there for implicit PLOT statements). string gk[] = { "copy", "next", "draw", "new", "line", "define", "arrow", "circle", "plot", "at", "frame", "graph", "coord", "for", "if", "print", "sprintf", "ticks", "tick", "label", "grid", "pic", "sh", "bar", "ljust", "rjust", "above", "below", "aligned", "unaligned", "size", "undefine", "clipped", "unclipped", "color", "strftime" }; // These are the keywords recognized by any keyword that takes a line // descriptor: string lk[] = { "invis", "solid", "dotted", "dashed", "fill", "fillcolor", "color", "thickness" }; // Keywords recognized for sting modifiers string sk[] = { "ljust", "rjust", "above", "below", "aligned", "unaligned", "size", "clipped", "unclipped", "color" }; // Keywords recognized by ticks and graph string tk[] = { "left", "right", "up", "down", "bottom", "bot", "top", "in", "out", "from", "to", "by", "at", "off", "on", "auto", "sprintf", "color", "strftime" }; // Vector versions of these vector grap_keys(gk, gk+sizeof(gk)/sizeof(string)); vector linedesc_keys(lk, lk+sizeof(lk)/sizeof(string)); vector strmod_keys(sk, sk+sizeof(sk)/sizeof(string)); vector tick_keys(tk, tk+sizeof(tk)/sizeof(string)); // The data structure encapsulating the keyword handling algorithms keywordDictionary keywords; // This builds a large hash table encapsulating the actions to take // when a keyword is parsed. This is one big static data structure, // and should just be statically initialized, but is complex enough // that building it is easier to maintain. It's split into // subfunctions primarily because the gcc optimizer has a terrible // time with the one big function, and partially to make it easier to // maintain. // All these can appear multiple times in a command void init_multiples() { vector empty; keywords["above"] = keyword(empty, empty, false, ABOVE); keywords["top"] = keyword(empty, empty, false, TOP); keywords["bot"] = keywords["bottom"] = keyword(empty, empty, false, BOTTOM); keywords["left"] = keyword(empty, empty, false, LEFT); keywords["right"] = keyword(empty, empty, false, RIGHT); keywords["up"] = keyword(empty, empty, false, UP); keywords["down"] = keyword(empty, empty, false, DOWN); keywords["ljust"] = keyword(empty, empty, false, LJUST); keywords["rjust"] = keyword(empty, empty, false, RJUST); keywords["below"] = keyword(empty, empty, false, BELOW); keywords["aligned"] = keyword(empty, empty, false, ALIGNED); keywords["unaligned"] = keyword(empty, empty, false, UNALIGNED); keywords["clipped"] = keyword(empty, empty, false, CLIPPED); keywords["unclipped"] = keyword(empty, empty, false, UNCLIPPED); keywords["size"] = keyword(empty, empty, false, SIZE); keywords["in"] = keyword(empty, empty, false, IN); keywords["out"] = keyword(empty, empty, false, OUT); keywords["off"] = keyword(empty, empty, false, OFF); keywords["on"] = keywords["auto"] = keyword(empty, empty, false, ON); keywords["fill"] = keyword(empty, empty, false, FILL); keywords["invis"] = keyword(empty, empty, false, INVIS); keywords["solid"] = keyword(empty, empty, false, SOLID); keywords["dotted"] = keyword(empty, empty, false, DOTTED); keywords["dashed"] = keyword(empty, empty, false, DASHED); keywords["fillcolor"] = keyword(empty, empty, false, FILLCOLOR); keywords["color"] = keyword(empty, empty, false, COLOR); keywords["thickness"] = keyword(empty, empty, false, THICKNESS); keywords["sprintf"] = keyword(empty, empty, false, SPRINTF); keywords["strftime"] = keyword(empty, empty, false, STRFTIME); } // These are all one time command modifiers void init_only_once() { vector empty; vector temp; // temp.clear(); temp.push_back("radius"); temp.push_back("rad"); keywords["radius"] = keywords["rad"] = keyword(empty, temp, false, RADIUS); temp.clear(); temp.push_back("from"); keywords["from"] = keyword(empty, temp, false, FROM); temp.clear(); temp.push_back("thru"); temp.push_back("through"); keywords["thru"] = keywords["through"] = keyword(empty, temp, false, THRU); temp.clear(); temp.push_back("to"); keywords["to"] = keyword(empty, temp, false, TO); temp.clear(); temp.push_back("by"); keywords["by"] = keyword(empty, temp, false, BY); temp.clear(); temp.push_back("until"); keywords["until"] = keyword(empty, temp, false, UNTIL); temp.clear(); temp.push_back("do"); keywords["do"] = keyword(empty, temp, false, DO); temp.clear(); temp.push_back("x"); keywords["x"] = keyword(empty, temp, false, XDIM); temp.clear(); temp.push_back("y"); keywords["y"] = keyword(empty, temp, false, YDIM); temp.clear(); temp.push_back("base"); keywords["base"] = keyword(empty, temp, false, BASE); temp.clear(); temp.push_back("ht"); keywords["ht"] = keyword(empty, temp, false, HT); temp.clear(); temp.push_back("wid"); keywords["wid"] = keyword(empty, temp, false, WID); temp.clear(); temp.push_back("at"); temp.insert(temp.end(), strmod_keys.begin(), strmod_keys.end()); keywords["plot"] = keyword(temp, empty, true, PLOT); } // These all signal the start of a command void init_line_starters() { vector empty; vector temp; temp.clear(); temp.push_back("thru"); temp.push_back("through"); temp.push_back("until"); keywords["copy"] = keyword(temp, empty, true, COPY); temp = linedesc_keys; temp.push_back("at"); temp.push_back("sprintf"); temp.push_back("strftime"); keywords["next"] = keyword(temp, empty, true, NEXT); temp = linedesc_keys; temp.insert(temp.end(), strmod_keys.begin(), strmod_keys.end()); temp.push_back("sprintf"); temp.push_back("strftime"); keywords["draw"] = keywords["new"] = keyword(temp, empty, true, DRAW); temp = linedesc_keys; temp.push_back("from"); temp.push_back("to"); keywords["line"] = keyword(temp, empty, true, LINE); temp = linedesc_keys; temp.push_back("from"); temp.push_back("to"); keywords["arrow"] = keyword(temp, empty, true, ARROW); temp = linedesc_keys; temp.push_back("at"); temp.push_back("radius"); temp.push_back("rad"); keywords["circle"] = keyword(temp, empty, true, CIRCLE); temp = linedesc_keys; temp.push_back("top"); temp.push_back("bottom"); temp.push_back("bot"); temp.push_back("left"); temp.push_back("right"); temp.push_back("ht"); temp.push_back("wid"); keywords["frame"] = keyword(temp, empty, true, FRAME); temp.clear(); temp.push_back("x"); temp.push_back("y"); temp.push_back("log"); keywords["coord"] = keyword(temp, empty, true, COORD); temp.clear(); temp.push_back("from"); temp.push_back("to"); temp.push_back("by"); temp.push_back("do"); keywords["for"] = keyword(temp, empty, true, FOR); temp.clear(); temp.push_back("then"); keywords["if"] = keyword(temp, empty, true, IF); temp.clear(); temp.push_back("else"); keywords["then"] = keyword(temp, empty, true, THEN); temp = tick_keys; temp.insert(temp.end(), strmod_keys.begin(), strmod_keys.end()); keywords["tick"] = keywords["ticks"] = keyword(temp, empty, true, TICKS); temp = strmod_keys; temp.push_back("left"); temp.push_back("right"); temp.push_back("up"); temp.push_back("down"); temp.push_back("bottom"); temp.push_back("bot"); temp.push_back("top"); temp.push_back("sprintf"); temp.push_back("strftime"); keywords["label"] = keyword(temp, empty, true, LABEL); temp = linedesc_keys; temp.insert(temp.end(), tick_keys.begin(), tick_keys.end()); temp.insert(temp.end(), strmod_keys.begin(), strmod_keys.end()); temp.push_back("ticks"); temp.push_back("tick"); keywords["grid"] = keyword(temp, empty, true, GRID); temp = linedesc_keys; temp.push_back("ht"); temp.push_back("wid"); temp.push_back("up"); temp.push_back("right"); temp.push_back("base"); keywords["bar"] = keyword(temp, empty, true, BAR); } // These have special parsing rules. They clear the active commands. void init_wipers() { vector empty; keywords["define"] = keyword(empty, empty, true, DEFINE); keywords["undefine"] = keyword(empty, empty, true, UNDEFINE); keywords["graph"] = keyword(empty, empty, true, GRAPH); keywords["else"] = keyword(empty, empty, true, ELSE); keywords["print"] = keyword(empty, empty, true, PRINT); keywords["pic"] = keyword(empty, empty, true, PIC); keywords["sh"] = keyword(empty, empty, true, SH); } // This are used in parsing multi-element matches for macros. bool id_letter[256]; // set up the table to scan for embedded macros void init_id() { int i; // Scratch for (i = 0; i < 256; i++ ) id_letter[i] = false; // assumes letters are contiguous. Is there still any character set // for this which doesn't hold? for ( i = 'a'; i <= 'z' ; i++ ) id_letter[i] = true; for ( i = 'A'; i <= 'Z' ; i++ ) id_letter[i] = true; for ( i = '0'; i <= '9' ; i++ ) id_letter[i] = true; id_letter[static_cast('_')] = true; } // Initialize the table of keywords. void init_keywords() { vector empty; init_multiples(); init_only_once(); init_line_starters(); init_wipers(); // init the table init_id(); } grap-1.49/NEWS0000664000175000017500000000007014546364223010030 00000000000000See CHANGES (automake barfs if this file isn't around) grap-1.49/Makefile.in0000664000175000017500000010550715000074631011374 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = grap$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/grap.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(dist_defines_DATA) $(dist_doc_DATA) \ $(dist_example_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(definesdir)" "$(DESTDIR)$(docdir)" \ "$(DESTDIR)$(exampledir)" PROGRAMS = $(bin_PROGRAMS) am_grap_OBJECTS = grap_draw.$(OBJEXT) grap_pic.$(OBJEXT) \ grap_parse.$(OBJEXT) grap_tokenizer.$(OBJEXT) nodist_grap_OBJECTS = grap.$(OBJEXT) grap_lex.$(OBJEXT) grap_OBJECTS = $(am_grap_OBJECTS) $(nodist_grap_OBJECTS) am__DEPENDENCIES_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/grap.Po ./$(DEPDIR)/grap_draw.Po \ ./$(DEPDIR)/grap_lex.Po ./$(DEPDIR)/grap_parse.Po \ ./$(DEPDIR)/grap_pic.Po ./$(DEPDIR)/grap_tokenizer.Po \ ./$(DEPDIR)/strdup.Po ./$(DEPDIR)/strerror.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(grap_SOURCES) $(EXTRA_grap_SOURCES) $(nodist_grap_SOURCES) DIST_SOURCES = $(grap_SOURCES) $(EXTRA_grap_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) DATA = $(dist_defines_DATA) $(dist_doc_DATA) $(dist_example_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \ $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ README depcomp install-sh missing ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CX0FLAGS = @CX0FLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFINES_DIR = @DEFINES_DIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_DIR = @DOC_DIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXAMPLE_DIR = @EXAMPLE_DIR@ EXEEXT = @EXEEXT@ # Support for compiling our own strdup and strerror if needed. We don't use # LIBOBJS directly because automake thinks the sources for LIBOBJS are C files. GRAPLIBOBJS = @GRAPLIBOBJS@ GREP = @GREP@ GXXFLAGS = @GXXFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_DEPS = @INSTALL_DEPS@ INSTALL_DOCS = @INSTALL_DOCS@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NO_UNDEF = @NO_UNDEF@ OBJEXT = @OBJEXT@ OS_VERSION = @OS_VERSION@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SUPPRESS_OPT = @SUPPRESS_OPT@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ # Other docs docdir = @DOC_DIR@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ grap_SOURCES = grap_draw.cc grap_pic.cc grap_parse.cc grap_tokenizer.cc nodist_grap_SOURCES = grap.yy grap_lex.ll y.tab.h EXTRA_DIST = grap.h grap_data.h grap_draw.h grap_pic.h grap_string.h snprintf.h\ grap.yy grap_lex.ll grap.spec BUILT_SOURCES = y.tab.h grap_LDADD = $(GRAPLIBOBJS) grap_DEPENDENCIES = $(GRAPLIBOBJS) EXTRA_grap_SOURCES = strdup.cc strerror.cc # Delete generated files on clean CLEANFILES = grap.cc grap_lex.cc grap.man y.tab.h # Man page dist_man1_MANS = grap.doc # Where to put grap.defines definesdir = @DEFINES_DIR@ dist_defines_DATA = grap*.defines # Examples exampledir = @EXAMPLE_DIR@ dist_example_DATA = examples/*.d examples/*.result examples/Makefile \ examples/example.ms dist_doc_DATA = README CHANGES COPYRIGHT grap.man # Configure supplied C++ flags AM_CXXFLAGS = @GXXFLAGS@ @CX0FLAGS@ all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cc .ll .o .obj .yy am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) grap$(EXEEXT): $(grap_OBJECTS) $(grap_DEPENDENCIES) $(EXTRA_grap_DEPENDENCIES) @rm -f grap$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(grap_OBJECTS) $(grap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grap_draw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grap_lex.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grap_parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grap_pic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grap_tokenizer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .ll.cc: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) grap_lex.cc: grap_lex.ll $(AM_V_LEX) \ $(SHELL) $(YLWRAP) `test -f 'grap_lex.ll' || echo '$(srcdir)/'`grap_lex.ll $(LEX_OUTPUT_ROOT).c grap_lex.cc -- $(LEX) $(AM_LFLAGS) $(LFLAGS) .yy.cc: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) grap.cc: grap.yy $(AM_V_YACC) \ $(SHELL) $(YLWRAP) `test -f 'grap.yy' || echo '$(srcdir)/'`grap.yy y.tab.c grap.cc y.tab.h `echo grap.cc | $(am__yacc_c2h)` y.output grap.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dist_definesDATA: $(dist_defines_DATA) @$(NORMAL_INSTALL) @list='$(dist_defines_DATA)'; test -n "$(definesdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(definesdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(definesdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(definesdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(definesdir)" || exit $$?; \ done uninstall-dist_definesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_defines_DATA)'; test -n "$(definesdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(definesdir)'; $(am__uninstall_files_from_dir) install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) install-dist_exampleDATA: $(dist_example_DATA) @$(NORMAL_INSTALL) @list='$(dist_example_DATA)'; test -n "$(exampledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(exampledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(exampledir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exampledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(exampledir)" || exit $$?; \ done uninstall-dist_exampleDATA: @$(NORMAL_UNINSTALL) @list='$(dist_example_DATA)'; test -n "$(exampledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(exampledir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(definesdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(exampledir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -rm -f grap.cc -rm -f grap_lex.cc -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/grap.Po -rm -f ./$(DEPDIR)/grap_draw.Po -rm -f ./$(DEPDIR)/grap_lex.Po -rm -f ./$(DEPDIR)/grap_parse.Po -rm -f ./$(DEPDIR)/grap_pic.Po -rm -f ./$(DEPDIR)/grap_tokenizer.Po -rm -f ./$(DEPDIR)/strdup.Po -rm -f ./$(DEPDIR)/strerror.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_definesDATA install-dist_docDATA \ install-dist_exampleDATA install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/grap.Po -rm -f ./$(DEPDIR)/grap_draw.Po -rm -f ./$(DEPDIR)/grap_lex.Po -rm -f ./$(DEPDIR)/grap_parse.Po -rm -f ./$(DEPDIR)/grap_pic.Po -rm -f ./$(DEPDIR)/grap_tokenizer.Po -rm -f ./$(DEPDIR)/strdup.Po -rm -f ./$(DEPDIR)/strerror.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_definesDATA \ uninstall-dist_docDATA uninstall-dist_exampleDATA \ uninstall-man uninstall-man: uninstall-man1 .MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ check-am clean clean-binPROGRAMS clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dist_definesDATA install-dist_docDATA \ install-dist_exampleDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dist_definesDATA uninstall-dist_docDATA \ uninstall-dist_exampleDATA uninstall-man uninstall-man1 .PRECIOUS: Makefile # Rules for y.tab.h and grap.man y.tab.h: grap.yy ${YACC} -d grap.yy && rm -f y.tab.c grap.man: grap.doc groff -mdoc -Tascii grap.doc > grap.man # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: grap-1.49/CHANGES0000664000175000017500000006214015000076377010326 00000000000000Change log 1.49 Fix a bug where I was handling a string::find return value in a bad way. You should probably upgrade to this. 1.48 Change output pic to be more amenable to dpic implementation of pic. See https://github.com/snorerot13/grap/pull/4 . 1.47 Simplify autoconf for portability and (I hope) modernity. The grap.spec is also updated and may even be easier to use. 1.46 Handle multiple label lines correctly (thanks to Bruce Lilly for pointing that out). Be more careful about scaling rand() returns. 1.45 Eric Raymond caught a typo in the grap man page. Various small code changes to remove clang and recent g++ warnings. 1.44 Modern g++ seems to dislike *printf without a constant format string if there are no other arguments and was causing compiles to fail. Fixed warning and patch from Tobias Quathamer. Manpage spelling fix from Tobias Quathamer. John Heidemann pointed out that plot doesn't accept modifiers to strings (though he didn't phrase it that way). The short form is that plot bullet at x,y wasn't working. I've adjusted plot to make the string modifiers into active keywords, which fixes the problem. Someone named Y T pointed out that there was no mod operator (%). There is now. This marks the transition from my home brewed Makefiles to automake-generated makefiles. A couple largely unused options went away, but with any luck we still build everywhere. Robert Daasch submitted a patch to include floor and ceil functions. That's been incorporated. (His patch also included adding a mod operator, but I'd already done that.) Added minimal support for dates, by adding versions of strftime and strptime that return and accept seconds since the unix epoch. 1.43 Bruce Lilly pointed out that g++ 4.3.1 was emitting all sorts of dire warnings about the hash_map data structure and associated support being pulled from g++ in the future. SuSe seems to ship with this and there's no point scaring people (or letting a time bomb tick). Grap now detects and uses unordered_map if it's present on your system, which stops the wailing and gnashing of teeth from g++ 4.3.1 . That g++ version also requires a compiler option to support that include file, which we also autodetect and use. (This is essentially autodetecting the flags described in the changes to grap 1.41 below, along with some code changes to make that actually function correctly.) A fellow named Fergus had a Cygwin compilation problem as well. His system apparently had rand but not random (a very rare configuration these days). This led me to find a corner of the autoconf code that I apparently hadn't checked sufficiently. If rand was found and a declaration made in the system files, the grap config stuff failed to note the declaration and made its own incompatible one. This should be gone now. Fergus's system also seemed to be lacking snprintf - which again is very odd. I hadn't reflected the change to grap sprintf in version 1.23 into the code that emulates snprintf on systems without it. That code has been added. Changed the examples to include a brief tutorial on string matching in grap. Suggested by John Heidemann. 1.42 There's been a long standing bug with how different versions of pic interpret the "line from (x,y) then down 5" construct. There was once a bug report at http://lists.gnu.org/archive/html/groff/2008-03/msg00003.html about this. As of version 1.42 grap no longer outputs this pic construct. Dan Lasley pointed out that the key was incomplete for the bar graph example. His fix to restore the key is included. John Heidemann points out that bars in coordinate systems other than the default just didn't work. This was a bug in my yacc grammar - for heaven's sake. It's corrected to match the manual page. For loops were strange in that .G1 for xx from 15 to 13 do { print "YYY" } print "ZZZZ" .G2 would loop infinitely. xx never passes 13. Added a test to make that a null loop as well as making .G1 for xx from 13 to 13 do { print "YYY" } print "ZZZZ" .G2 print one "YYY". You can still confuse loops, using strange by clauses - for example "by 0" or "by * -1" but common cases should be covered. Spotted by a fellow named Yuval. Found a lurking initializer bug while fixing the for loop thing. I added references to standard plot strings in a couple places to make them somewhat easier to find. 1.41 Small changes to compile without warnings under g++ 4.2.0 and to find and use ext/hash_map under g++ versions that include it. Incorporated Tobias Toedter's patch to the grap.spec. I'd found another place to misspell "Kernighan" and Tobias fixed it. Got rid of an ambiguous else construct in grap_pic.cc Support g++4.3.0 by either compiling under compatibility headers (with a warning) or using the c++0x standard header if you set CXXFLAGS=-std=c++0x CPPFLAGS=-std=c++0x in the environment (during configure and compile). Using unordered_set avoids the warnings, but is experimental. 1.40 Man, here's a weird one, care of Bruce Lilly: in previous versions doing something like this: coord temp x -2,2 y 3,4 ticks left out from temp -1 to 1 would interpret the ticks as starting from the value of the uninitialized variable temp with one subtracted from it to 1 in the default coordinate space rather than (correctly) interpreting that as ticks from -1 to 1 in the temp coordinate space. This is a two character fix to a regular expression, but a weird bug. I believe it's fixed. Bruce also discovered that the changes I put into version 1.38 to address issues raised by Hartmut Henkel affected large number comparisons in unpleasantly non-intuitive ways. Specifically doing this: coord pressure x -2.400000, 27.000000 y 1035.124000, 1039.000000 ticks right in left 0.6 from pressure 1035.200 to 1039.000000 by 0.200 Results in the top tick - the one at 1039 - being clipped because the 19 additions in the tick loop introduce enough floating point error that the limit (1039) and the index (1039+epsilon) differ by a large enough value that the loop terminates one iteration early. Essentially the <= at the top of the tick loop fails because the error induced by the 19 additions accumulates to be detectable. I've reverted the default comparison thresholds back to their pre-1.38 levels; numbers must differ by more than 1e-6 to be considered different by grap. For people who explicitly want to work with very small quantities directly - a decision I still disagree with - the -r flag has been added to make grap use the system's idea of what the smallest comparable numbers are (the 1.38 and 1.39 behavior). The output of -v or -h lists these two values and the manual page documents the flags. I've updated the grap.spec to one donated by John Heidemann. Linux guys should have it easier. 1.39 Martin Michlmayr noticed a typo that upsets gcc 4.1, though earlier versions don't even generate a warning (Grrrr). (Original report at .) This is fixed. I didn't issue a new FreeBSD port, because it doesn't change anything functionally. I also cleaned up the man page a bit, and Tobias Toedter fixed a couple typos in the man page and the README file. Always troubling to misspell the inventor's name. 1.38 Michail Vidiassov suggests that a DESTDIR variable be added to the Makefile to allow staged installs or temporary installs or other stuff. Setting DESTDIR when making install or deinstall will create a tree under DESTDIR that contains the full grap install. E.g., make DESTDIR=/usr/tmp install Does something like: /usr/bin/install -c -d /usr/tmp/usr/local/share/doc/grap || true /usr/bin/install -c -m 644 README CHANGES COPYRIGHT grap.man /usr/tmp/usr/local/share/doc/grap strip grap || true /usr/bin/install -c -d /usr/tmp/usr/local/bin || true /usr/bin/install -c -d /usr/tmp/usr/local/man/man1 || true /usr/bin/install -c -d /usr/tmp/usr/local/share/grap || true /usr/bin/install -c -d /usr/tmp/usr/local/share/examples/grap || true /usr/bin/install -c grap /usr/tmp/usr/local/bin /usr/bin/install -c -m 644 grap.1 /usr/tmp/usr/local/man/man1 /usr/bin/install -c -m 644 grap*.defines /usr/tmp/usr/local/share/grap /usr/bin/install -c -m 644 examples/*.d examples/example.ms \ examples/*.result examples/Makefile \ /usr/tmp/usr/local/share/examples/grap There is a possibility of munging the manpage by doing this, but that's actually pretty difficult, and the modifications below to print install locations will still print the original (that is DESTDIR-free) install locations. Warner Lemberg found a bunch of bad typesetting in the examples, and I hope much of that is fixed. He also pointed out that configure should allow installers to place documentation and examples where their system likes them. I've altered the configuration script to accept these locations as --with arguments (--help lists them). grap -v or grap -h (or the long versions: grap --version/grap --help) prints out the examples/documentation locations and that new behavior is documented in the manual page. (The locations aren't directly given in the man page, because the ASCII and postscript versions of the manual are created before the source tar file is so that grap man pages can be installed places that don't have doc manual pages). Fixed a bug where lines acquired the lindescription of the last drawn line. This was a typo level error that just never got exercised. Thanks to Steve Blinkhorn for finding it. Steve also points out that thickness attributes on frames were being ignored. They're not anymore, but they're of limited usefulness and they don't thicken the ticks. The easiest way to draw a thick frame with thick ticks is: .G1 pic linethick=5 frame .\" ticks statement here pic linethick=1 draw solid bullet next at 1,2 next at 3,4 .G2 That draws a thick frame and thin line. I integrated some changes suggested by Hartmut Henkel to better handle graphing small numbers. I didn't include his patch exactly, but I think that most of the functionality has been added. His test cases look the same. If you're graphing things in the 1e-30 range, you should see autoscaling and not have your graph stop at 1e-6, assuming that your compiler has . I really think it's a bad idea to graph in that domain, as the math with numbers that small can be really hairy, and grap isn't exactly tuned for numerical analysis. But I think we do better now. 1.37 Fixed an error handling bug where an error at end of file/line could cause a core dump. Yuk. 1.36 Joel M. Cook pointed out that plot "\(bu" at 0, -306 didn't work. grap was requiring a numeric expression before the format string. I think I've had that discussion before, but I decided to support the behavior this time. Now both the expression and the format string are optional. plot at x,y will plot a 0 at x,y. plot "x" at x,y is exactly equivalent to "x" at x,y in output, but slightly slower. plot 3 at x,y works as before as does plot 2 "%g of clubs" at x,y I also modified the grammar to accept the base and wid parameters to bar in any order. 1.35 Changes to lex code to compiler under newer versions of lex and configure code to activate them. Several people pointed out the problem and I like Bruce Lilly's solution best. Configure bugs are all mine. Bruce Lilly also noticed that copy statements with a macro and neither an until nor a filename didn't work as they should. He provided the fix for that. Bill Ward pointed out that grap should support gpic's "thickness" just like the color attributes. So now it does. And an apology to R. Clayton who sent patches for this very thing that I lost until after I'd implemented. 1.32: Whoops. Color modifiers were mis parsed in implicit plot statements. Now things like : bullet color "blue" at 1, 3 work. Minor code tweaks to make grap compile under g++ 3.4.2 1.31: In compatibility mode grap will no longer add whitespace around graphs. I like it, but Yuval Tamir rightly complained. 1.30: Made the undocumented color commands support GNU pic color commands. In other words added color to grap. Probably the easiest place to see the syntax is the new example added to the examples file. The changes are on the manual page, too, but the example sets basically everything that can be set, so it's a good example. 1.27: A couple compilation bugs reported under later g++ versions by a couple people have been fixed. Brian Mays caught a clipping bug, and Bruce Lilly also caught a couple compiler dependencies. 1.26: .lf was appearing outside the PS/PE pairs, so I disabled generation of those lines. 1.25: Fixed a bug parsing draw/new with no line descriptions. Thanks to Robert W. Numrich for spotting it. Cygwin seems to need errno.h to declare errno in grap_lex.l. I added the machinery to look for it and use it if it's there. I also added a couple missing semi-colons to grap.y to shut bison up. Added the clipped and unclipped attributes to allow plot statements to place strings outside the frame. Tuned the makefile so you can use pmake in parallel. 1.23: made it possible to disable sprintf and other calls to sprintf(3) with a user given format string, which is a potential security hole. Fixed a plot bug I found while disabling that. 1.22: John Heidemann caught a bug with respect to large sizes and size changes in titles. Those large size changes are now supported. Generally the groff [] syntax is now used for the embedded \s commands that size generates. This can be turned off by using -C. John also wanted to be able to specify string modifiers like size, etc. on ticks. Now ticks, grids, and plot strings (e.g. in a new or draw statement) all take string modifiers. grap.defines has been changed to support and encourage this usage. A bug where a null graph was output when only a draw statement was given has been corrected. sprintf processing has been revamped to more directly follow sprintf syntax. As a result, a limitation on the number of parameters (10) has been introduced. As a result of using string attributes on plotting strings, the name of the default line has become user-visible. Changing grap_internal_default via new will change the default lines for the rest of the graph. It's not encouraged. 1.21: Allow redefinition of keywords as macros. In the process, I added an undefine keyword to do the obvious: remove a macro. Added xy_gg macros, too. Fixed a bug where giving a coordinate name before a parenthesized point caused a syntax error. Thanks to Kees Zeelenberg for spotting this. Added an srand function to seed the random number generator, though there's none documented in Kernighan and Bentley's grap, and a getpid function to get a (sort of) random number. Don't use this for key generation. W. Robert Daasc caught this omission. While I was in there, I discovered that rand was not returning its full range from [0,1). It does now. Some keywords that accept strings weren't accepting sprintf, some of them have been fixed. Lee Ji Hwan found a bug with large files being read thru macros causing a core dump. That has been fixed. It was a really embarrassing coding style error, too... John Aycock discovered a bug where a line style was ignored on the first line command executed. It's not ignored anymore. I also found a bug in the execution order of copy through macros, although I'm uncertain if a version was ever released with the bug intact. I think this may have been related to Lee Ji Hwan's bug, which means it probably hasn't seen the light of day. -h prints a usage summary. --help is a synonym for -h and --version is a synonym for -v. 1.20: The big jump reflects both internal changes and visible feature changes. The class structure in the code has been substantially revamped, and the code brought into better conformance with the current state of the C++ world. As of version 1.20, grap no longer attempts to compile under g++ 2.7.2. grap 1.11 source will remain available from http://www.lunabase.org/~faber/Vault/software/grap for those who need it. One feature change is that troff and pic commands are now placed correctly in their relative order rather than being collected before and after the graph. This required specifying more carefully where the frame generation is placed. Frames are output either immediately before the first plotted object or after the frame statement, if any. This change motivated much of the class changes and actually cleaned them up somewhat. grap is now *much* more tolerant of variables with the keyword names. Things like from=1; to = 10 for i from from to to do { ... } now work. This is due to a sizable rewrite of the tokenizer. In fact, variables and coordinate spaces can share names. Things like: for next = 0 to 10 do { next at next next, next } now work (you have to add a couple ticks statements to really see that example). I'd say we're to the point where obfuscated grap programs are a possibility. The only change this necessitated was that if you specify a coordinate system in an automatic ticks statement, you have to use the on or auto keyword. See the examples document for an example. I recoded macros to remove an antiquated construct that was confusing some non-g++ compilers. A static array was recoded as an STL vector, with the result that an artificial constraint on the number of arguments in a macro went away. Part of the recoding of the tokenizer encoded a large data structure in a file called grap_tokenizer.cc. The code is striaght-ahead initialization, but it drives the g++ optimizer stone crazy. (Optimizing this function is very memory intensive.) By default, optimization is specifically disabled under g++. You can override that behavior by specifying --enable-optimize-grap_tokenizer to ./configure. On the machines I use, optimizing this module has absolutely no effect on performance, and I suggest you don't bother spending the time optimizing it. The autoconf and make stuff has been revamped to use GNU make's automatic makefile generation or BSD pmake's automatic .depend inclusion, as well as simplifying the distribution creation and caching all configuration values. Added some GNU standard Makefile targets to the Makefile. Fixed some bugs in the manual page. Ran spell again on the examples. Misspelling Brian Kernighan's name is bad. Many additional compatibility changes suggested by Bruce Lilly. 1.11: Strings are now clipped, thanks to John Heidemann for finding the error. 1.10: Cleaned up the automatic tick generation and fixed a bug in there, too. Allow reassignment of coordinate system parameters, e.g., .G1 coord test copy "examples/cy_fatal.d" coord test x 1980,2000 .G2 Default line format now uses the bullet macro if it's defined. The coord statement now will accept multiple log scale modifiers. The statement coord x 1,1000 log x log y is now legal. x and y are now legal variable names. They used to be language tokens, and in fact still are, although their scope as tokens is now limited to coord statements. Tried to streamline the use of for_each and functors by removing trivial calls to for_each. Still trying to move code out of grap.y to make it shorter to compile. Simplified expression grammar by disallowing logical expressions outside if statements. I also caught another memory leak here. Signifying a line break by using new (or draw) now works. So code like .G1 draw solid next at 2,4 next at 3,5 new next at 4,6 next at 5,7 .G2 produces 2 solid line segments. This forced a little rethinking of the syntax for changing the properties of a line using new/draw. The implementation is on the man page. If it breaks existing grap scripts, I'd love to hear about it. Grids support similar syntax to that of ticks for explicitly requesting automatic grid generation. Automatic tock or grid generation can now be requested relative to a named coordinate system, formerly automatic ticks/grid lines were only generated for the default coordinate system. Added the ln function. Why did that take me so long? Revised and (finally) spell-checked the man page. I also stopped including the auto-generated manual page in an macros. A text version of the man page is now installed, but the manual uses the doc macros exclusively. Line clipping was added in here, too. 1.06: Added an anonymous donor's TeX defines. Also added the -C compatibility option for groff and fixed some manpage formatting bugs. 1.05: kromJx@crosswinds.net noticed that numbers like 1. weren't accepted. They are now. While I was fixing that I noticed that copy until commands without a macro weren't supported. They are now. Made a minor change to the examples to test the fixes. 1.03: Added the -M path option to make groff handle grap better. I also added the GRAP_DEFINES environment variable to change the defines file. I also added a new source file, grap_parse.cc in an attempt to break up the monolithic and gigantic grap.y. I had some small success. In the course of creating grap_parse.cc I think I caught some memory leaks, too. 1.02: Bruce's error handling code produced a few inconsistencies (eating the last newline of a file, and adding one before the file. I think it no longer does that. In addition I took care of a error placement bug when the error was in a line containing a macro expansion, and changed the error handling from using char * to using Strings, like the rest of grap. Got rid of an error on SunOS (and presumably other architectures) where -0 labels were printed on auto-generated labels. Fixed bugs in sprintf when compiled using standard strings. Fixed a memory leak and general bug with the undocumented color commands. (There, that'll tell me if anyone reads this!) 1.01: Fixed a compilation bug under RedHat 6.1. Cleaned up autoconf and tweaked the makefile. 1.0: Incorporated Bruce Lilly's error reporting code. Cleaned up the documents (including a mention for Bruce in the man page) for v1.0 release. Cleared up a file reading bug. 0.98b: Bruce Lilly reported some bugs and DWP incompatibilities, mainly with negative numbers in number lists and comma separations in them. He also compiles in UWIN under NT, which broke autoconf in some weird ways. The most important of these necessitated adding a check to ensure that install supports -d. His test case is in the example file now. He also found some spelling errors. The README file now reflects the real state of the world, too. More kudos to Bruce. While tinkering with those autoconf changes I found that grap didn't compile under g++ 2.7.2.1 any more. Good thing that 0.97b wasn't really released. All is well again. More fun from Bruce: he's given me patches to make cascading assignments work and to remove a bug with comments not acting as separators. I've also make the order of copy commands more flexible (the until can go before or after an inline macro, for example) and fixed a bug in the grammar that made it difficult to put general expressions in places like the frame size. Expressions can go anywhere now, at the expense that string comparisons can only appear in if statements. Those bugs were also spotted by Bruce. 0.97b: Finally have a copy of egcs, so grap will now compile under it using both the stl and the standard string class. What do you know, compiling under egcs halves the run time. This is roughly half due to better egcs compilation and half due to the better performance of the standard string class. Moved to a config.h-style grap.h. Smoothed out the header files to confine as much conditional compilation as possible to grap.h. The code now uses hash_maps if they're available. 0.95b: bug fix: deleting grap_buffer_state contents twice on error, allow more than one shift description on ticks, grids, and labels. Thanks to Anindo Banerjea at ISI for spotting my misimplementation. Another couple of Bannerjea catches: through is now recognized as a synonym for thru. "For," "then" and "else" clauses were previously treated as macros but now have a terminating separator added to them. The result is that things like if (x == 3) { y = y + 1 } x = x + 1 work now. (If the { } is treated as a macro defined and expanded on the spot, the grap parser sees y = y + 1x = x + 1 and cannot parse the expression y+1x). The new behavior is both more intuitive and more in line with previous grap implementations. More from Anindo: expansion of macro arguments assumed that the only possible character following a dollar sign was a single digit. This caused problems both when a non-digit followed and the $ was literal, and when the intent was to access an argument with an index greater than 9. Argument expansion now only expands when a $ is followed by 1 or more digits, and includes all the digits in the index. The frame statement will now accept the default line style before or after the frame size. I still don't accept things like frame ht 3 solid wid 3 - the specifications of the size must be contiguous. 0.92a: bug fix - string equality check. Small change to Makefile.in to support default Solaris behavior. Added -v for version info. Some general internals fiddling (I'd like to call it cleanup, but I think that's generous). 0.91a: small changes for the RPM 0.9a: Added commands for making bars. Error reporting is much closer to the correct line now. Generalized line descriptions for fillable objects. Circles now take a line description. Added new examples of fillable objects. Now using the BSD copyright notice instead of my own half-baked one. 0.8a: alpha release grap-1.49/grap_pic.cc0000664000175000017500000006103214616462067011434 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "grap.h" #include "grap_data.h" #include "grap_draw.h" #include "grap_pic.h" // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. // Convert the abstract types to Pictypes and draw them. These are // called from for_each. These are declared outside the pic classes // to keep g++ 2.7.3 happy. template class draw_f : public unary_function { frame *f; public: draw_f(frame *fr) : f(fr) { } int operator()(FROM *ds) { TO p(*ds); p.draw(f); return 0; } }; // Simpler declarations typedef draw_f draw_string_f; typedef draw_f draw_tick_f; typedef draw_f draw_grid_f; // A little helper function - tells if a DisplayString * points to a string // with the clipped attribute. In an anonymous namespace so no one else has to // see it. namespace { bool clipped(DisplayString *d) { return d->clip; } } extern bool compat_mode; void Picgraph::init(string *n /* =0 */, string* p /* =0 */ ) { // Start a new graph, but maybe not a new block. if ( frame_queued ) base = 0; graph::init(n, p); // clear the base classes parameters if ( !base ) base = pframe = new Picframe; if ( p ) pos = new string(*p); frame_queued = false; } void Picgraph::draw(frame *) { // Do the work of drawing the current graph. displayer_f displayer(pframe); // Call draw on the object. This is // an embedded class of graph. if ( visible ) { if ( !graphs++ ) { cout << ".PS"; if (ps_param ) { cout << *ps_param; delete ps_param; ps_param = 0; } cout << endl; } // if we have a name, use it if ( name ) cout << *name << ": "; // The graph itself cout << "[" << endl; for_each(coords.begin(), coords.end(), addmargin); // put out the xy_gg mpic macros for (coordinateDictionary::iterator ci = coords.begin(); ci != coords.end(); ci++) { Piccoord pc(*(*ci).second); displayer(&pc); } for_each(objs.begin(), objs.end(), displayer); cout << "]"; // Positioning info relative to another graph in this block if ( pos ) { cout << " " << *pos << endl; delete pos; pos = 0; } else cout << endl; } } void PicDisplayString::draw(frame *) { // Draw a display string. Basically just a straight translation into // pic/troff idioms. cout << '"'; if ( size ) { if ( relsz ) { char relchar = ( size > 0 ) ? '+' : '-'; size = fabs(size); if ( compat_mode ) { cout << "\\s" << relchar; cout << ((size > 9) ? "(" : "") << size; } else { cout << "\\s[" << relchar << size << "]"; } } else { // double digit size changes need the ( using classic troff. Groff // allows a general [] syntax, that we use if available ). if ( compat_mode ) cout << "\\s" << ((size > 9) ? "(" : "") << size; else cout << "\\s[" << size << "]"; } } if ( color && !compat_mode ) { unquote(color); cout << "\\m[" << *color << "]"; } unquote(this); cout << *(string*)this; if ( color && !compat_mode ) cout << "\\m[]"; if ( size ) cout << "\\s" << 0 ; cout << "\" "; if ( j & (int) ljust ) cout << "ljust "; if ( j & (int) rjust ) cout << "rjust "; if ( j & (int) above ) cout << "above "; if ( j & (int) below ) cout << "below "; if ( j & (int) aligned ) cout << "aligned "; } void Picframe::frame_line(double x2, double y2, sides s) { // straightforward line drawing of one frame line switch (s) { case left_side: cout << "Left: "; break; case right_side: cout << "Right: "; break; case top_side: cout << "Top: "; break; case bottom_side: cout << "Bottom: "; break; } cout << "line "; switch (desc[s].ld) { case invis: cout << "invis "; break; case solid: default: break; case dotted: cout << "dotted "; if ( desc[s].param ) cout << desc[s].param << " "; break; case dashed: cout << "dashed "; if ( desc[s].param ) cout << desc[s].param << " "; break; } if ( !compat_mode ) { if ( desc[s].color ) cout << " color " << *desc[s].color << " " ; if ( desc[s].thick ) cout << " thickness " << desc[s].thick << " " ; } cout << "right " << x2 << " up " << y2 << endl; } void Picframe::label_line(sides s) { // Label a graph side. We rely heavily on pic tricks here. The C++ // is straightforward. // Functor to convert a DisplayString to a PicdisplayString and print it draw_string_f draw_string(this); double dx, dy; // Used to place the alignment line relative to the axis labellist::iterator cli; shiftlist::const_iterator csi; for (cli = label[s]->begin(); cli != label[s]->end(); cli++) { switch (s) { case left_side: dx = -0.4; dy = 0; break; case right_side: dx = 0.4; dy = 0; break; case top_side: dx = 0; dy = 0.4; break; case bottom_side: dx = 0; dy = -0.4; break; default: // to keep the compiler quiet dx = dy = 0; break; } for (csi = (*cli)->shifts->begin(); csi != (*cli)->shifts->end(); csi++) { switch ((*csi)->dir) { case left_side: dx -= (*csi)->param; break; case right_side: dx += (*csi)->param; break; case top_side: dy += (*csi)->param; break; case bottom_side: dy -= (*csi)->param; break; } } // DWB grap did not put the whitespace around for unlabelled sizes of the // graph, so omit that space if in compatibility mode. if ( compat_mode && (*cli)->strs->empty() ) return; cout << "line invis "; // draw all the labels for_each((*cli)->strs->begin(), (*cli)->strs->end(), draw_string); switch (s) { case left_side: cout << "from Frame.Left.start + ("; cout << dx << ", " << dy << ") "; cout << "to Frame.Left.end + ("; cout << dx << ", " << dy << ") "; break; case right_side: cout << "from Frame.Right.start + ("; cout << dx << ", " << dy << ") "; cout << "to Frame.Right.end + ("; cout << dx << ", " << dy << ") " ; break; case bottom_side: cout << "from Frame.Bottom.end + ("; cout << dx << ", " << dy << ") "; cout << "to Frame.Bottom.start + ("; cout << dx << ", " << dy << ") "; break; case top_side: cout << "from Frame.Top.start + ("; cout << dx << ", " << dy << ") " ; cout << "to Frame.Top.end + ("; cout << dx << ", " << dy << ") " ; break; default: break; } cout << endl; } } void Picframe::autoguess(sides sd, double &idx, double& dir, double& lim, double &ts, int& ls, coord *c) { // Calculate a reasonable placement of tickmarks if the user has not // specified one. We aim for 5. The algorithm is heuristic. double lo, hi; // Low and high tickmarks double range; // the range of the coordinate system // determine the range of the axes if ( sd == bottom_side || sd == top_side ) { lo = c->xmin; hi = c->xmax; ls = (c->logscale & x_axis); } else { lo = c->ymin; hi = c->ymax; ls = (c->logscale & y_axis); } // Make our ticksize guess if ( !ls ) { range = fabs(hi - lo); ts = pow(10,floor(log10(range))); while ( range/ts > 4 ) ts *= 2; while ( range/ts < 3 ) ts /=2; idx = ts * ceil(lo/ts); } else { idx = pow(10,floor(log10(lo))); } // On machines with signed 0 representations, this ensures that // tickmarks have a 0 label (not a -0). See math(3). if ( idx == -0.0 ) idx = 0.0; // Are ticks increasing or decreasing? if ( hi - lo < 0 ) dir = -1; else dir = 1; lim = hi; } void Picframe::addautoticks(sides sd) { // Place ticks in accordance with the parameters returned by autoguess double ts; // The tick size (for linear axes) double dir, idx; // The direction of ticks and an index value double hi; // the tick limit int ls; // is this a logscale axis? tick *t; // Temporary tick value if ( tickdef[sd].size == 0 ) return; autoguess(sd, idx, dir, hi, ts, ls, tickdef[sd].c); // This changed to match the code in grap_parse (all the computations on // one side of the comparison) while ( (idx - hi)* dir < epsilon ) { t = new tick(idx,tickdef[sd].size,sd,0, &tickdef[sd].shift, tickdef[sd].c); if ( tickdef[sd].prt) t->prt = new DisplayString(idx,tickdef[sd].prt); //t->prt = dblString(idx,tickdef[sd].prt); tks.push_back(t); if ( ls ) idx *= 10; else idx += ts; } } void Picframe::addautogrids(sides sd) { // Place grids in accordance with the parameters returned by autoguess double ts; double dir, idx; double hi; int ls; grid *g; if ( griddef[sd].desc.ld == def ) return; autoguess(sd, idx, dir, hi, ts, ls, griddef[sd].c); while ( (idx - hi)*dir < epsilon ) { g = new grid(idx,&griddef[sd].desc,sd,0, &griddef[sd].shift, griddef[sd].c); if ( griddef[sd].prt) // g->prt = dblString(idx,griddef[sd].prt); g->prt = new DisplayString(idx,griddef[sd].prt); gds.push_back(g); if ( ls ) idx *= 10; else idx += ts; } } void Picframe::draw(frame *) { // Draw the frame. Autotick if necessary and draw the axes and // tickmarks. Straightforward application of the helpers above. The // result is a frame that is labelled for pic placement of other // graphs in the same block. // functors to draw ticks and grids out of the lists. draw_tick_f draw_tick(this); draw_grid_f draw_grid(this); cout << "Frame: [" << endl; cout << "Origin: Here" << endl; frame_line(0,ht,left_side); frame_line(wid,0,top_side); frame_line(0,-ht,right_side); frame_line(-wid,0,bottom_side); cout << "]" << endl; for ( int i = 0; i < 4 ; i++ ) { if ( label[(sides)i] ) label_line((sides)i); addautoticks((sides)i); addautogrids((sides)i); } for_each(tks.begin(), tks.end(), draw_tick); for_each(gds.begin(), gds.end(), draw_grid); } bool Piclinesegment::clipx(double& x1, double& y1, double& x2, double& y2) { // Clip the line to x = 0 and x = 1. We use the parametric // representation of the line for simplicity of calculation. This // gets called with the coordinates reversed to do the y-axis clip. // the line is p + tv where x1, y1 is t==0 and x2, y2 is t==1 double px = x1; // Point coordinate double py = y1; // Point coordinate double vx = x2 - x1; // vector component double vy = y2 - y1; // vector component double t; // The parameter // The line is parallel to the x axis. It's either all valid or // all invalid. We use epsilon again here to be conservative. if ( vx > -epsilon && vx < epsilon ) { if ( inbox(px) ) return true; else return false; } // Do the x = 0 intercept t = -px / vx; // The semantics of inbox here mean that the line has been // clipped. The intersection with x = 0 is between x1, y1 (t==0) // and x2, y2 (t==1). if ( inbox(t) ) { // This is the zero intercept, and one point has been clipped, // so if the first hasn't been clipped, the second must have. // We recalculate the parametric representation so we can // repeat the clip for x == 1. We use epsilon here because we have to // use it by definition in the t==1 half. if ( px < epsilon ) { x1 = px + t * vx; y1 = py + t * vy; px = x1; py = y1; } else { x2 = px + t * vx; y2 = py + t * vy; } vx = x2 - x1; vy = y2 - y1; } // repeat for 1 t = (1 - px) / vx; // The semantics of inbox here mean that the line has been // clipped. if ( inbox(t) ) { // This is the 1 intercept, and one point has been clipped, // so if the first hasn't been clipped, the second must have. if ( px > 1 - epsilon ) { x1 = px + t * vx; y1 = py + t * vy; } else { x2 = px + t * vx; y2 = py + t * vy; } } // If both x points are clipped to inside the box, we have a line, // otherwise, the whole line is invalid. return inbox(x1) && inbox(x2); } bool Piclinesegment::clip(double& x1, double& y1, double& x2, double& y2) { // If all 4 points are in the frame, return true. If not call // clip twice to clip the lines, and return true only if both // clips return valid lines. There is a little sleight of hand // there: the && guarantees that we only keep clipping while there // is a line to clip. if ( inbox(x1) && inbox(x2) && inbox(y1) && inbox(y2) ) return true; else return clipx(x1, y1, x2, y2) && clipx(y1, x1, y2, x2); } void Piclinesegment::draw(frame *f) { // Draw this line segment. Clip the line segment according to the // point's coordinates, then put them into the graph. There are some // details to laying out the styles and plotting strings correctly. double x,y; // The current point's coordinates double lastcx, lastcy; // The last point plotted post clipping double cx,cy; // The current point post clipping try { x = to.c->map(to.x,x_axis); y = to.c->map(to.y,y_axis); } catch (range_error &e) { cerr << "Unable to map point: (" << to.x << ", " << to.y << ") : " << e.what() << endl; return; } if ( from ) { try { lastcx = from->c->map(from->x, x_axis); lastcy = from->c->map(from->y, y_axis); } catch (range_error &e) { cerr << "Unable to map point: (" << to.x << ", " << to.y << ") : " << e.what() << endl; return; } } cx = x; cy = y; if ( !from || clip(lastcx, lastcy, cx, cy) ) { // If clipping has left us a (partial) line to draw, do // so. This also is invoked on the first point of a line. if ( !from ) { if ( inbox(x) && inbox(y) ) cout << "move to Frame.Origin + (" << x * f->wid << ", " << y * f->ht << ")" << endl; } else { // Chop off the arrowhead if the line is clipped if ( arrow && inbox(x) && inbox(y) ) cout << "arrow "; else cout << "line "; switch (desc.ld) { case invis: cout << "invis "; break; case solid: default: break; case dotted: cout << "dotted "; if ( desc.param ) cout << desc.param << " "; break; case dashed: cout << "dashed "; if ( desc.param ) cout << desc.param << " "; break; } if ( !compat_mode ) { if ( desc.color ) cout << " color " << *desc.color << " " ; if ( desc.thick ) cout << " thickness " << desc.thick << " " ; } cout << "from Frame.Origin + (" << lastcx * f->wid << ", " << lastcy * f->ht << ") "; cout << "to Frame.Origin + (" << cx * f->wid << ", " << cy * f->ht << ")" << endl; } // if a plot string has been specified and the point has // not been clipped, put the plotstring out. if ( plotstr && inbox(x) && inbox(y) ) { PicDisplayString pstr(*plotstr); pstr.draw(f); if ( !from ) cout << " at Frame.Origin + (" << x * f->wid << ", " << y * f->ht << ")" << endl; else cout << " at last line.end" << endl; } } } void Pictick::draw(frame *f) { // Actually draw a tick mark. Map it into the appropriate coordinate // space and draw and label the line. The translation from data // structure to pic is straightforward. double a,b; // x and y offsets from the origin string dir; // Direction of the tick mark string just; // placement of the label relative to the end of the tick Picshiftdraw sd(cout); // Functor to put out multiple tick shifts try { switch (side) { default: case left_side: a = 0; b = c->map(where,y_axis); dir = "left"; just = "rjust"; break; case right_side: a = 1; b = c->map(where,y_axis); dir = "right"; just = "ljust"; break; case top_side: a = c->map(where,x_axis); b = 1; dir = "up"; just = "above"; break; case bottom_side: a = c->map(where,x_axis); b = 0; dir = "down"; just = "below"; break; } } catch (range_error& e) { cerr << "failed to map tick value: " << where << ": " << e.what() << endl; return; } // epsilons for floating point weirdness if ( a < -epsilon || a > 1+epsilon ) return; else a *= f->wid; if ( b < -epsilon || b > 1+epsilon ) return; else b *= f->ht; cout << "move to Frame.Origin + (" << a << ", " << b << ")" << endl; cout << "line " << dir << " " << size << endl; if ( prt ) { double dist; if ( size > 0 ) dist = 1.2 * size; else dist = 0; cout << "move to Frame.Origin + (" << a << ", " << b << ")" << endl; cout << "move " << dir << " " << dist << endl; for_each(shift.begin(), shift.end(), sd); quote(prt); PicDisplayString pprt(*prt); pprt.draw(f); cout << " " << just << " at Here" << endl; } } void Picgrid::draw(frame *f) { // Draw a grid line. As usual very similar to a tick. double a,b; double len; string dir; Picshiftdraw sd(cout); // Functor to put out multiple tick shifts try { switch (side) { default: case left_side: a = 0; b = c->map(where,y_axis); dir = "right"; len = f->wid; break; case right_side: a = 1; b = c->map(where,y_axis); dir = "left"; len = f->wid; break; case top_side: a = c->map(where,x_axis); b = 1; dir = "down"; len = f->ht; break; case bottom_side: a = c->map(where,x_axis); b = 0; dir = "up"; len = f->ht; break; } } catch (range_error& e) { cerr << "failed to map grid value: " << where << ": " << e.what() << endl; return; } if ( a < 0 || a > 1 ) return; else a *= f->wid; if ( b < 0 || b > 1 ) return; else b *= f->ht; cout << "move to Frame.Origin + (" << a << ", " << b << ")" << endl; cout << "line "; switch (desc.ld) { case invis: cout << "invis "; break; case solid: default: break; case dotted: cout << "dotted "; if ( desc.param ) cout << desc.param << " "; break; case dashed: cout << "dashed "; if ( desc.param ) cout << desc.param << " "; break; } if ( !compat_mode ) { if ( desc.color ) cout << " color " << *desc.color << " "; if ( desc.thick ) cout << " thickness " << desc.thick << " "; } cout << dir << " " << len << endl; if ( prt ) { cout << "move to Frame.Origin + (" << a << ", " << b << ")" << endl; cout << "move " << dir << " -0.125" << endl; for_each(shift.begin(), shift.end(), sd); quote(prt); PicDisplayString pprt(*prt); pprt.draw(f); cout << " at Here" << endl; } } void Piccircle::draw(frame *f) { // Plot a circle. Strightforward. double x,y; // To transform the point into device coordinates try { x = center.c->map(center.x,x_axis); y = center.c->map(center.y,y_axis); } catch (range_error& e) { cerr << "Unable to map circle at (" << center.x << ", " << center.y << ") into " << "log coordinates: " << e.what() << endl; return; } // Again, epsilon is correct because it's needed for the 1+ and symmetry. if ( x > 1+epsilon || x < 0-epsilon ) { cerr << "Circle outside coordinates:" << center.x << ", "; cerr << center.y << endl; return; } if ( y > 1+epsilon || y < 0-epsilon ) { cerr << "Circle outside coordinates:" << center.x << ", "; cerr << center.y << endl; return; } x *= f->wid; y *= f->ht; cout << "circle at Frame.Origin + (" << x << ", " << y << ")"; cout << " rad " << rad ; switch (ld.ld) { case invis: cout << " invis "; break; case solid: default: break; case dotted: cout << " dotted "; if ( ld.param ) cout << ld.param << " "; break; case dashed: cout << " dashed "; if ( ld.param ) cout << ld.param << " "; break; } if ( !compat_mode ) { if ( ld.fillcolor ) { // fillcolor takes precedence over fill - if fillcolor is not // null, we draw one box filled with that color, and then a // second unfilled one in color (black is none specified) ld.fill = 0; cout << " shaded " << *ld.fillcolor << " "; } // Draw the circle with appropriate line style, fill, and color if ( ld.color ) cout << " outline " << *ld.color << " "; if ( ld.thick ) cout << " thick " << ld.thick << " " ; } if ( ld.fill ) cout << " fill " << ld.fill; cout << endl; } void Picbox::draw(frame *f) { // Plot the box. If there is a fill color, plot it twice so that // the box and edge can be different colors double x1,y1, x2,y2; // The box edges in device coords. double ht, wid; // height and width in device units (inches) try { x1 = p1.c->map(p1.x,x_axis); y1 = p1.c->map(p1.y,y_axis); x2 = p2.c->map(p2.x,x_axis); y2 = p2.c->map(p2.y,y_axis); } catch (range_error& e) { cerr << "Unable to map box [(" << p1.x << ", " << p1.y << "), (" << p2.x << ", " << p2.y << ")] into logscale : " << e.what() << endl; return; } // make (x1,y1) upper right and (x2,y2) lower left if ( x1 < x2 ) swap(x1,x2); if ( y1 < y2) swap(y1,y2); // Clip the box // If the box is entirely out of frame, ignore it. epsilon for 1+ and // symmetry. if ( (x1 > 1+epsilon && x2 > 1+epsilon) || (x1 <-epsilon && x2 < -epsilon ) ) return; if ( (y1 > 1+epsilon && y2 > 1+epsilon) || (y1 <-epsilon && y2 < -epsilon ) ) return; // Box is at least partially in frame - clip it if ( x1 > 1+epsilon) x1 = 1; if ( y1 > 1+epsilon) y1 = 1; if ( x2 < -epsilon) x2 = 0; if ( y2 < -epsilon) y2 = 0; x1 *= f->wid; y1 *= f->ht; x2 *= f->wid; y2 *= f->ht; wid = fabs(x1-x2); ht = fabs(y1-y2); cout << "box ht " << ht << " wid " << wid ; cout << " with .ne at Frame.Origin + (" << x1 << ", " << y1 << ")"; switch (ld.ld) { case invis: cout << " invis "; break; case solid: default: break; case dotted: cout << " dotted "; if ( ld.param ) cout << ld.param << " "; break; case dashed: cout << " dashed "; if ( ld.param ) cout << ld.param << " "; break; } if ( !compat_mode ) { if ( ld.fillcolor ) { // fillcolor takes precedence over fill - if fillcolor is not // null, we draw one box filled with that color, and then a // second unfilled one in color (black is none specified) ld.fill = 0; cout << " shaded " << *ld.fillcolor << " "; } if ( ld.color ) cout << " outline " << *ld.color << " " ; if ( ld.thick ) cout << " thickness " << ld.thick << " " ; } if ( ld.fill ) cout << " fill " << ld.fill; cout << endl; } void Picplot::draw(frame *f) { // Slightly trickier than the circle because we have to output a list // of strings instead of one. A functor to convert the DisplayStrings // to PicDisplayStrings and plot them simplifies matters. double x, y; // To transform the point into device coordinates bool in_frame = true; // To print a set of strings draw_string_f draw_string(f); if ( !strs || !loc ) return; try { x = f->wid * loc->c->map(loc->x,x_axis); y = f->ht * loc->c->map(loc->y,y_axis); } catch (range_error& e) { cerr << "Unable to place string at (" << loc->x << ", " << loc->y << "): " << e.what() << endl; return; } // Clip strings to lie in the graph (if requested) if ( x < -epsilon || x > f->wid + epsilon ) in_frame = false; if ( y < -epsilon || y > f->ht + epsilon ) in_frame = false; // Make a copy of all the DisplayStrings that are really displayed - either // all of them, if the plot is in the graph, or the unclipped ones if the // plot is off the graph. stringlist v; if ( in_frame ) copy(strs->begin(), strs->end(), back_inserter(v)); else remove_copy_if(strs->begin(), strs->end(), back_inserter(v), clipped); // If there are strings to show, show them. if ( v.size() ) { for_each(v.begin(), v.end(), draw_string); cout << "at Frame.Origin + (" << x << ", " << y << ")" << endl; } // Now v will go out of scope and disappear, leaving the object itself // alone. } grap-1.49/aclocal.m40000664000175000017500000011737315000074630011172 00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # 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, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR grap-1.49/grap_draw.cc0000664000175000017500000001160014546364223011607 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "grap.h" #include "grap_data.h" #include "grap_draw.h" // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. void coord::newx(double x) { // Specific code to add the x value. If the axis is being autoscaled, // see if this point expands it. Otherwise, sanity check it. if ( xautoscale == 2) { xmax = (x > xmax ) ? x : xmax; xmin = (x < xmin ) ? x : xmin; } if ( xautoscale == 1 ) { // first point xmax = xmin = x; xautoscale = 2; } if ( (logscale & x_axis) ) { if ( xmin < min_double ) { cerr << "Logscale with non-positive value (within precision)" << endl; xmin = min_double; } if ( xmax < min_double ) { cerr << "Logscale with non-positive value (within precision)" << endl; xmax = min_double; } } } void coord::newy(double y) { // Specific code to add the x value. If the axis is being autoscaled, // see if this point expands it. Otherwise, sanity check it. if ( yautoscale == 2) { ymax = (y > ymax ) ? y : ymax; ymin = (y < ymin ) ? y : ymin; } if ( yautoscale == 1 ) { // first point ymax = ymin = y; yautoscale = 2; } if ( (logscale & y_axis) ) { if ( ymin < min_double ) { cerr << "Logscale with non-positive value (within precision)" << endl; ymin = min_double; } if ( ymax < min_double ) { cerr << "Logscale with non-positive value (within precision)" << endl; ymax = min_double; } } } void coord::addmargin(double mf) { // Add a margin to the coordinate system to center the plot better. // The margin factor(mf) is given as a multiplier to the current size // (0.07 is 7% on either size). If the axis is logarithmic, we have // to work in that space. double range; // The size of the axis we're working on // Log sale must be positive if ( (logscale & x_axis) ) { if ( xmin < min_double ) xmin = min_double; if ( xmax < min_double ) xmax = min_double; } if ( (logscale & y_axis) ) { if ( ymin < min_double ) ymin = min_double; if ( ymax < min_double ) ymax = min_double; } if ( xautoscale ) { if ( logscale & x_axis) { double b, t; // bottom and top of the logscale range // Solving the log mapping equation for 1+mf and -mf // Isn't math cool? b = pow(xmax,-mf) / pow(xmin,(-mf-1)); t = pow(xmax,1+mf) / pow(xmin,mf); xmin = b; xmax = t; } else { range = xmax - xmin; xmin = xmin - mf * range; xmax = xmax + mf * range; } } if ( yautoscale ) { if ( logscale & y_axis) { double b, t; // bottom and top of the logscale range // Solving the log mapping equation for 1+mf and -mf // Isn't math cool? b = pow(ymax,-mf) / pow(ymin,(-mf-1)); t = pow(ymax,1+mf) / pow(ymin,mf); ymin = b; ymax = t; } else { range = ymax - ymin; ymin = ymin - mf * range; ymax = ymax + mf * range; } } // If they're too close together, just punt. (Actually this is less a punt // than it looks like. Adding 1 works if no points have been added that // would define a grid - xmin == xmax == 0 and if you do almost nothing you // get a (0,1) x (0,1) frame). if ( xmax == xmin) xmax += 1.0; if ( ymax == ymin) ymax += 1.0; } double coord::map(double v, axis ax ) { // map the coordinate from data space to [0,1]. 1 is the top of the axis, // 0 the bottom. Do it right for logscale or Cartesian coordinates switch ( ax ) { case x_axis: if (logscale & x_axis ) { if ( v > min_double ) return ((log(v) -log(xmin)) / (log(xmax)-log(xmin))); else throw range_error("Negative or zero logscale coordinate"); } else return ( (v - xmin) / (xmax - xmin ) ); break; case y_axis: if (logscale & y_axis ) { if ( v > min_double ) return ((log(v) -log(ymin)) / (log(ymax)-log(ymin))); else throw range_error("Negative or zero logscale coordinate"); } else return ( (v - ymin) / (ymax - ymin ) ); break; default: return -1; break; } } // Linesegment constructor. Too long for a header, but // straightforward. Connect this segment to the previous point in the // line. linesegment::linesegment(double xx, double yy, coord* cc, line *ll, DisplayString *s /* =0 */, linedesc *l /* =0 */, bool a /* =false */) : to(xx,yy,cc), from(0) { point *p; // The last point on line ll. // If a null linedesc is passed in, use the one in the line if ( l ) desc = *l; else desc = ll->desc; if ( s ) plotstr = new DisplayString(*s); else { if ( ll->plotstr ) plotstr = new DisplayString(*ll->plotstr); else plotstr = 0; } arrow = a; if ((p = ll->lastplotted())) from = new point(p); ll->lastplotted(&to); } grap-1.49/grap.man0000664000175000017500000012417215000074267010761 00000000000000GRAP(1) BSD General Commands Manual GRAP(1) NNAAMMEE ggrraapp -- Kernighan and Bentley's language for typesetting graphs SSYYNNOOPPSSIISS ggrraapp [--dd _d_e_f_i_n_e_s___f_i_l_e] [--DD] [--ll] [--MM _i_n_c_l_u_d_e _p_a_t_h] [--RR] [--rr] [--vv] [--uu] [--CC] [--cc] [--hh] [_f_i_l_e_n_a_m_e _._._.] DDEESSCCRRIIPPTTIIOONN ggrraapp is an implementation of Kernighan and Bentley's language for type- setting graphs, as described in ``Grap-A Language for Typesetting Graphs, Tutorial and User Manual,'' by Jon L. Bentley and Brian W. Kernighan, revised May 1991, which is the primary source for information on how to use ggrraapp. As of this writing, it is available electronically at http://www.kohala.com/start/troff/cstr114.ps. Additional documentation and examples, packaged with ggrraapp, may have been installed locally as well. If available, paths to them can be displayed using ggrraapp --hh or ggrraapp --vv (or ggrraapp ----hheellpp / ggrraapp ----vveerrssiioonn) This version is a black box implementation of ggrraapp, and some inconsisten- cies are to be expected. The remainder of this manual page will briefly outline the ggrraapp language as implemented here. ggrraapp is a pic(1) pre-processor. It takes commands embedded in a troff(1) source file which are surrounded by ..GG11 and ..GG22 macros, and rewrites them into pic commands to display the graph. Other lines are copied. Output is always to the standard output, which is usually redirected. Input is from the given _f_i_l_e_n_a_m_es, which are read in order. A _f_i_l_e_n_a_m_e of -- is the standard input. If no _f_i_l_e_n_a_m_es are given, input is read from the standard input. Because ggrraapp is a pic preprocessor, and GNU pic will output TeX, it is possible to use ggrraapp with TeX. The --dd option specifies a file of macro definitions to be read at startup, and defaults to /usr/local/share/grap/grap.defines . The --DD op- tion inhibits the reading of any initial macros file (the --ll flag is a synonym for --DD, though I do not remember why). The defines file can also be given using the GRAP_DEFINES environment variable. (See below). --vv prints the version information on the standard output and exits. ----vveerrssiioonn is a synonym for --vv. --uu makes labels unaligned by default. This version of ggrraapp uses new fea- tures of GNU pic to align the left and right labels with the axes, that is that the left and right labels run at right angles to the text of the paper. This may be useful in porting old ggrraapp programs. --cc makes plot strings unclipped by default. Some versions of ggrraapp allow users to place a string anywhere in the coordinate space, rather than only in the frame. By default this version of ggrraapp does not plot any string centered outside the frame. --cc allows strings to be placed anywhere. See also the cclliippppeedd and uunncclliippppeedd string modifiers described in the pplloott statement. --MM is followed by a colon-separated list of directories used to search for relative pathnames included via ccooppyy. The path is also used to lo- cate the defines file, so if the --dd changes the defines file name to a relative name, it will be searched for in the path given by --MM. The search path always includes the current directory, and by default that directory is searched last. All numbers used internally by ggrraapp are double precision floating point values. Sometimes using floating point numbers has unintended conse- quences. To help avoid these problems, ggrraapp can use two thresholds for comparison of floating point numbers, set by --RR or --rr. The --RR flag sets coarse comparison mode, which is suitable for most applications. If you are plotting small values - less than 1e-6 or so - consider using --rr which uses very fine comparisons between numbers. You may also want to rescale your plotted values to be larger in magnitude. The coarse compar- isons are used by default. To be precise, the value by which two numbers must differ for ggrraapp to consider them not equal is called the comparison limit and the smallest non-zero number is called the minimum value. The values a given version of ggrraapp uses for these are included in the output of --vv or --hh. All ggrraapp commands are included between ..GG11 and ..GG22 macros, which are con- sumed by ggrraapp. The output contains pic between ..PPSS and ..PPEE macros. Any arguments to the ..GG11 macro in the input are arguments to the ..PPSS macro in the output, so graphs can be scaled just like pic diagrams. If --CC is given, any macro beginning with .G1 or .G2 is treated as a .G1 or .G2 macro, for compatibility with old versions of troff. Using --CC also forces pure troff syntax on embedded font change commands when strings have the ssiizzee attribute, and all strings to be uunncclliippppeedd. The --hh flag prints a brief help message and exits. ----hheellpp is a synonym for --hh. It is possible for someone to cause ggrraapp to fail by passing a bad format string and data to the sspprriinnttff command. If ggrraapp is integrated as part of the printing system, this could conceivably provided a path to breaching security on the machine. If you choose to use ggrraapp as part of a printing system run by the super-user, you should disable sspprriinnttff commands. This can be done by calling ggrraapp with the --SS flag, setting the GRAP_SAFER en- vironment variable, or compiling with the GRAP_SAFER preprocessor symbol defined. (The GNU configure script included with ggrraapp will define that preprocessor symbol if the ----wwiitthh--ggrraapp--ssaaffee option is given.) The ggrraapp commands are sketched below. Refer to Kernighan and Bentley's paper for the details. New versions of groff(1) will invoke ggrraapp if --GG is given. CCoommmmaannddss Commands are separated from one another by newlines or semicolons (;). ffrraammee [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] [hhtt _h_e_i_g_h_t | wwiidd _w_i_d_t_h] [[(ttoopp|bboottttoomm|lleefftt| rriigghhtt) _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] ...] ffrraammee [hhtt _h_e_i_g_h_t | wwiidd _w_i_d_t_h] [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] [[(ttoopp|bboottttoomm|lleefftt| rriigghhtt) _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] ...] This describes how the axes for the graph are drawn. A _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n is a pic line description, e.g., dashed 0.5, or the literal solid. It may also include a ccoolloorr keyword followed by the color to draw the string in double quotes. Any color under- stood by the underlying groff system can be used. Color can only be used under GNU pic, and is not available in compatibility mode. Similarly, for pic implementations that understand tthhiicckknneessss, that attribute may be used with a real valued parameter. TThhiicckknneessss is not available in compatibility mode. If the first _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n is given, the frame is drawn with that style. The default is solid. The height and width of the frame can also be specified in inches. The default line style can be over-ridden for sides of the frame by specifying additional pa- rameters to ffrraammee. If no plotting commands have been given before the ffrraammee command is issued, the frame will be output at that point in the plotting stream relative to embedded troff or pic commands. Otherwise the frame is output before the first plotted object (even invisible ones). hhtt and wwiidd are in inches by default, but can be any groff unit. If omitted, the dimensions are 2 inches high by 3 inches wide. ccoooorrdd [_n_a_m_e] [xx _e_x_p_r, _e_x_p_r] [yy _e_x_p_r, _e_x_p_r] [lloogg xx | lloogg yy | lloogg lloogg] The ccoooorrdd command specifies a new coordinate system or sets limits on the default system. It defines the largest and smallest values that can be plotted, and therefore the scale of the data in the frame. The limits for the x and y coordinate systems can be given separately. If a _n_a_m_e is given, that coordinate system is defined, if not the default system is modified. A coordinate system created by one ccoooorrdd command may be modified by subsequent ccoooorrdd commands. A ggrraapp program may declare a coordinate space using ccoooorrdd, ccooppyy a file of data through a macro that plots the data and finds its maxima and minima, and then define the size of the coordinate system with a second ccoooorrdd statement. This command also determines if a scale is plotted logarithmically. lloogg lloogg means the same thing as lloogg xx lloogg yy. ddrraaww [_l_i_n_e___n_a_m_e] [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] [_p_l_o_t___s_t_r_i_n_g] The ddrraaww command defines the style with which a given line will be plotted. If _l_i_n_e___n_a_m_e is given, the style is associated with that name, otherwise the default style is set. _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n is a pic line description, and the optional _p_l_o_t___s_t_r_i_n_g is a string to be centered at each point. The default line description is invis, and the default plotting string is a centered bullet, so by default each point is a filled circle, and they are unconnected. If points are being connected, each ddrraaww command ends any current line and begins a new one. When defining a line style, that is the first ddrraaww command for a given line name, specifying no plot string means that there are to be no plot strings. Omitting the plot string on subsequent ddrraaww commands addressing the same named line means not to change the plot string. If a line has been defined with a plot string, and the format is changed by a subsequent ddrraaww statement, the plot string can be removed by specifying "" in the ddrraaww statement. The plot string can have its format changed through several string_modifiers. String_modifiers are described in the descrip- tion of the pplloott command. The standard defines file includes several macros useful as plot strings, including bbuulllleett, ssqquuaarree, and ddeellttaa. nneeww is a synonym for ddrraaww. nneexxtt [_l_i_n_e___n_a_m_e] aatt [_c_o_o_r_d_i_n_a_t_e_s___n_a_m_e] _e_x_p_r, _e_x_p_r [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] The nneexxtt command plots the given point using the line style given by _l_i_n_e___n_a_m_e, or the default if none is given. If _l_i_n_e___n_a_m_e is given, it should have been defined by an earlier ddrraaww command, if not a new line style with that name is created, initialized the same way as the default style. The two expressions give the point's x and y values, relative to the optional coordinate system. That system should have been defined by an earlier ccoooorrdd command, if not, grap will exit. If the optional _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n is given, it overrides the style's default line description. You cannot over-ride the plotting string. To use a different plotting string use the pplloott command. The coordinates may optionally be enclosed in parentheses: (_e_x_p_r, _e_x_p_r) _q_u_o_t_e_d___s_t_r_i_n_g [_s_t_r_i_n_g___m_o_d_i_f_i_e_r_s] [, _q_u_o_t_e_d___s_t_r_i_n_g [_s_t_r_i_n_g___m_o_d_i_f_i_e_r_s]] ... aatt [_c_o_o_r_d_i_n_a_t_e_s___n_a_m_e] _e_x_p_r, _e_x_p_r pplloott _e_x_p_r [_f_o_r_m_a_t___s_t_r_i_n_g] aatt [_c_o_o_r_d_i_n_a_t_e_s___n_a_m_e] _e_x_p_r, _e_x_p_r These commands both plot a string at the given point. In the first case the literal strings are stacked above each other. The string_modifiers include the pic justification modifiers (lljjuusstt, rrjjuusstt, aabboovvee, and bbeellooww), and absolute and relative size modifiers. See the pic documentation for the description of the justification modifiers. ggrraapp also supports the aalliiggnneedd and uunnaalliiggnneedd modifiers which are briefly noted in the description of the llaabbeell command. The standard defines file includes several macros useful as plot strings, including bbuulllleett, ssqquuaarree, and ddeellttaa. Strings placed by either format of the pplloott command are restricted to being within the frame. This can be overridden by using the uunncclliippppeedd attribute, which allows a string to be plotted in or out of the frame. The --cc and --CC flags set uunncclliippppeedd on all strings, and to prevent a string from being plotted outside the frame when those flags are active, the cclliippppeedd attribute can be used to re- store clipping behavior. Though cclliippppeedd or uunncclliippppeedd can be ap- plied to any string, it only has meaning for pplloott statements. size _e_x_p_r sets the string size to _e_x_p_r points. If _e_x_p_r is preceded by a + or -, the size is increased or decreased by that many points. If ccoolloorr and a color name in double quotes appears, the string will be rendered in that color under a version of GNU troff that sup- ports color. Color is not available in compatibility mode. In the second version, the _e_x_p_r is converted to a string and placed on the graph. _f_o_r_m_a_t___s_t_r_i_n_g is a printf(3) format string. Only formatting escapes for printing floating point numbers make sense. The format string is only respected if the sspprriinnttff command is also active. See the description of sspprriinnttff for the various ways to disable it. PPlloott and sspprriinnttff respond differently when ggrraapp is run- ning safely. SSpprriinnttff ignores any arguments, passing the format string through without substitution. pplloott ignores the format string completely, plotting _e_x_p_r using the "%g" format. Points are specified the same way as for nneexxtt commands, with the same consequences for undefined coordinate systems. The second form of this command is because the first form can be used with a ggrraapp sspprriinnttff expression (See _E_x_p_r_e_s_s_i_o_n_s). ttiicckkss (lleefftt|rriigghhtt|ttoopp|bboottttoomm)[ (iinn|oouutt) [_e_x_p_r]] [oonn||aauuttoo _c_o_o_r_d___n_a_m_e] ttiicckkss (lleefftt|rriigghhtt|ttoopp|bboottttoomm) (iinn|oouutt) [_e_x_p_r] [uupp _e_x_p_r | ddoowwnn _e_x_p_r | lleefftt _e_x_p_r | rriigghhtt _e_x_p_r] aatt [_c_o_o_r_d___n_a_m_e] _e_x_p_r [_f_o_r_m_a_t___s_t_r_i_n_g] [[, _e_x_p_r [_f_o_r_m_a_t___s_t_r_i_n_g]] ...] ttiicckkss (lleefftt|rriigghhtt|ttoopp|bboottttoomm) (iinn|oouutt) [_e_x_p_r] [uupp _e_x_p_r | ddoowwnn _e_x_p_r | lleefftt _e_x_p_r | rriigghhtt _e_x_p_r] ffrroomm [coord_name] _s_t_a_r_t___e_x_p_r ttoo _e_n_d___e_x_p_r [bbyy [+|-|*|/] _b_y___e_x_p_r] [format_string] ttiicckkss [lleefftt|rriigghhtt|ttoopp|bboottttoomm] ooffff This command controls the placement of ticks on the frame. By de- fault, ticks are automatically generated on the left and bottom sides of the frame. The first version of this command turns on the automatic tick gen- eration for a given side. The iinn or oouutt parameter controls the di- rection and length of the ticks. If a _c_o_o_r_d___n_a_m_e is specified, the ticks are automatically generated using that coordinate system. If no system is specified, the default coordinate system is used. As with nneexxtt and pplloott, the coordinate system must be declared before the ttiicckkss statement that references it. This syntax for requesting automatically generated ticks is an extension, and will not port to older ggrraapp implementations. The second version of the ttiicckkss command overrides the automatic placement of the ticks by specifying a list of coordinates at which to place the ticks. If the ticks are not defined with respect to the default coordinate system, the _c_o_o_r_d___n_a_m_e parameter must be given. For each tick a printf(3) style format string can be given. The _f_o_r_m_a_t___s_t_r_i_n_g defaults to "%g". The format string can also take string modifiers as described in the pplloott command. To place ticks with no labels, specify _f_o_r_m_a_t___s_t_r_i_n_g as "". If sspprriinnttff is disabled, ttiicckkss behaves as pplloott with respect to the format string. The labels on the ticks may be shifted by specifying a direction and the distance in inches to offset the label. That is the op- tional direction and expression immediately preceding the aatt. The third format of the ttiicckkss command over-rides the default tick generation with a set of ticks ar regular intervals. The syntax is reminiscent of programming language for loops. Ticks are placed starting at _s_t_a_r_t___e_x_p_r ending at _e_n_d___e_x_p_r one unit apart. If the bbyy clause is specified, ticks are _b_y___e_x_p_r units apart. If an oper- ator appears before _b_y___e_x_p_r each tick is operated on by that opera- tor instead of +. For example ticks left out from 2 to 32 by *2 will put ticks at 2, 4, 8, 16, and 32. If _f_o_r_m_a_t___s_t_r_i_n_g is speci- fied, all ticks are formatted using it. The parameters preceding the ffrroomm act as described above. The aatt and ffoorr forms of tick command may both be issued on the same side of a frame. For example: ticks left out from 2 to 32 by *2 ticks left in 3, 5, 7 will put ticks on the left side of the frame pointing out at 2, 4, 8, 16, and 32 and in at 3, 5, and 7. The final form of ttiicckkss turns off ticks on a given side. If no side is given the ticks for all sides are cancelled. ttiicckk is a synonym for ttiicckkss. ggrriidd (lleefftt|rriigghhtt|ttoopp|bboottttoomm) [ticks off] [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] [uupp _e_x_p_r | ddoowwnn _e_x_p_r | lleefftt _e_x_p_r | rriigghhtt _e_x_p_r] [oonn||aauuttoo [_c_o_o_r_d___n_a_m_e]] ggrriidd (lleefftt|rriigghhtt|ttoopp|bboottttoomm) [ticks off] [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] [uupp _e_x_p_r | ddoowwnn _e_x_p_r | lleefftt _e_x_p_r | rriigghhtt _e_x_p_r] aatt [_c_o_o_r_d___n_a_m_e] _e_x_p_r [_f_o_r_m_a_t___s_t_r_i_n_g] [[, _e_x_p_r [_f_o_r_m_a_t___s_t_r_i_n_g]] ...] ggrriidd (lleefftt|rriigghhtt|ttoopp|bboottttoomm) [ticks off] [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] [uupp _e_x_p_r | ddoowwnn _e_x_p_r | lleefftt _e_x_p_r | rriigghhtt _e_x_p_r] ffrroomm [coord_name] _s_t_a_r_t___e_x_p_r ttoo _e_n_d___e_x_p_r [bbyy [+|-|*|/] _b_y___e_x_p_r] [format_string] The ggrriidd command is similar to the ttiicckkss command except that ggrriidd specifies the placement of lines in the frame. The syntax is simi- lar to ttiicckkss as well. By specifying ticks off in the command, no ticks are drawn on that side of the frame. If ticks appear on a side by default, or have been declared by an earlier ttiicckkss command, ggrriidd does not cancel them unless ticks off is specified. Instead of a direction for ticks, ggrriidd allows the user to pick a line description for the grid lines. The usual pic line descrip- tions are allowed. Grids are labelled by default. To omit labels, specify the format string as "". If sspprriinnttff is disabled, ggrriidd behaves as pplloott with respect to the format string. llaabbeell (lleefftt|rriigghhtt|ttoopp|bboottttoomm) _q_u_o_t_e_d___s_t_r_i_n_g [_s_t_r_i_n_g___m_o_d_i_f_i_e_r_s] [, _q_u_o_t_e_d___s_t_r_i_n_g [_s_t_r_i_n_g___m_o_d_i_f_i_e_r_s]] ... [uupp _e_x_p_r | ddoowwnn _e_x_p_r | lleefftt _e_x_p_r | rriigghhtt _e_x_p_r] The llaabbeell command places a label on the given axis. It is possible to specify several labels, which will be stacked over each other as in pic. The final argument, if present, specifies how many inches the label is shifted from the axis. By default the labels on the left and right labels run parallel to the frame. You can cancel this by specifying unaligned as a _s_t_r_i_n_g___m_o_d_i_f_i_e_r. cciirrccllee aatt [_c_o_o_r_d_i_n_a_t_e___n_a_m_e] _e_x_p_r, _e_x_p_r [rraaddiiuuss _e_x_p_r] [_l_i_n_e_d_e_s_c] This draws an circle at the point indicated. By default, the cir- cle is small, 0.025 inches. This can be over-ridden by specifying a radius. The coordinates of the point are relative to the named coordinate system, or the default system if none is specified. This command has been extended to take a line description, e.g., dotted. It also accepts the filling extensions described below in the bbaarr command. It will also accept a ccoolloorr keyword that gives the color of the outline of the circle in double quotes and a ffiillllccoolloorr command that sets the color to fill the circle with simi- larly. Colors are only available when compatibility mode is off, and using a version of GNU pic that supports color. lliinnee [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] ffrroomm [_c_o_o_r_d_i_n_a_t_e___n_a_m_e] _e_x_p_r, _e_x_p_r ttoo [_c_o_o_r_d_i_n_a_t_e___n_a_m_e] _e_x_p_r, _e_x_p_r [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] aarrrrooww [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] ffrroomm [_c_o_o_r_d_i_n_a_t_e___n_a_m_e] _e_x_p_r, _e_x_p_r ttoo [_c_o_o_r_d_i_n_a_t_e___n_a_m_e] _e_x_p_r, _e_x_p_r [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] This draws a line or arrow from the first point to the second using the given style. The default line style is solid. The _l_i_n_e___d_e_s_c_r_i_p_t_i_o_n can be given either before the ffrroomm or after the ttoo clause. If both are given the second is used. It is possible to specify one point in one coordinate system and one in another, note that if both points are in a named coordinate system (even if they are in the same named coordinate system), both points must have _c_o_o_r_d_i_n_a_t_e___n_a_m_e given. ccooppyy ["_f_i_l_e_n_a_m_e"] [uunnttiill "_s_t_r_i_n_g"] [tthhrruu _m_a_c_r_o] The ccooppyy command imports data from another file into the current graph. The form with only a filename given is a simple file inclu- sion; the included file is simply read into the input stream and can contain arbitrary ggrraapp commands. The more common case is that it is a number list; see _N_u_m_b_e_r _L_i_s_t_s below. The second form takes lines from the file, splits them into words delimited by one or more spaces, and calls the given macro with those words as parameters. The macro may either be defined here, or be a macro defined earlier. See _M_a_c_r_o_s for more information on macros. The _f_i_l_e_n_a_m_e may be omitted if the uunnttiill clause is present. If so the current file is treated as the input file until _s_t_r_i_n_g is en- countered at the beginning of the line. ccooppyy is one of the workhorses of ggrraapp. Check out the paper and _/_u_s_r_/_l_o_c_a_l_/_s_h_a_r_e_/_e_x_a_m_p_l_e_s_/_g_r_a_p for more details. Confirm the loca- tion of the examples directory using the --vv flag. pprriinntt (_e_x_p_r_|_s_t_r_i_n_g) Prints its argument to the standard error. sshh _b_l_o_c_k This passes _b_l_o_c_k to sh(1). Unlike K&B ggrraapp no macro or variable expansion is done. I believe that this is also true for GNU pic version 1.10. See the _M_a_c_r_o_s section for information on defining blocks. ppiicc _p_i_c___s_t_a_t_e_m_e_n_t This issues the given pic statements in the enclosing ..PPSS and ..PPEE at the point where the command is issued. Statements that begin with a period are considered to be troff(statements) and are output in the enclosing ..PPSS and ..PPEE at the point where the command appears. For the purposes of relative placement of pic or troff commands, the frame is output immediately before the first plotted object, or the ffrraammee statement, if any. If the user specifies pic or troff commands and neither any plottable object nor a ffrraammee command, the commands will not be output. ggrraapphh _N_a_m_e _p_i_c___c_o_m_m_a_n_d_s This command is used to position graphs with respect to each other. The current graph is given the pic name _N_a_m_e (names used by pic be- gin with capital letters). Any pic commands following the graph are used to position the next graph. The frame of the graph is available for use with pic name Frame. The following places a sec- ond graph below the first: graph Linear [ graph description ] graph Exponential with .Frame.n at \ Linear.Frame.s - (0, .05) [ graph description ] _n_a_m_e _= _e_x_p_r This assigns _e_x_p_r to the variable _n_a_m_e. ggrraapp has only numeric (double) variables. Assignment creates a variable if it does not exist. Variables per- sist across graphs. Assignments can cascade; a = b = 35 assigns 35 to a and b. bbaarr (uupp|rriigghhtt) [_c_o_o_r_d_i_n_a_t_e_s___n_a_m_e] _o_f_f_s_e_t hhtt _h_e_i_g_h_t [wwiidd _w_i_d_t_h] [bbaassee _b_a_s_e___o_f_f_s_e_t] [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] bbaarr [_c_o_o_r_d_i_n_a_t_e_s___n_a_m_e] _e_x_p_r, _e_x_p_r, [_c_o_o_r_d_i_n_a_t_e_s___n_a_m_e] _e_x_p_r, _e_x_p_r, [_l_i_n_e___d_e_s_c_r_i_p_t_i_o_n] The bbaarr command facilitates drawing bar graphs. The first form of the command describes the bar somewhat generally and has ggrraapp place it. The bar may extend up or to the right, is centered on _o_f_f_s_e_t and extends up or right _h_e_i_g_h_t units (in the given coordinate sys- tem). For example bar up 3 ht 2 draws a 2 unit high bar sitting on the x axis, centered on x=3. By default bars are 1 unit wide, but this can be changed with the wwiidd keyword. By default bars sit on the base axis, i.e., bars directed up will extend from y=0. That may be overridden by the bbaassee key- word. (The bar described above has corners (2.5, 0) and (3.5, 2).) The line description has been extended to include a ffiillll _e_x_p_r key- word that specifies the shading inside the bar. Bars may be drawn in any line style. They support the ccoolloorr and ffiillllccoolloorr keywords described under cciirrccllee. The second form of the command draws a box with the two points as corners. This can be used to draw boxes highlighting certain data as well as bar graphs. Note that filled bars will cover data drawn under them. CCoonnttrrooll FFllooww iiff _e_x_p_r tthheenn _b_l_o_c_k [eellssee _b_l_o_c_k] The iiff statement provides simple conditional execution. If _e_x_p_r is non-zero, the _b_l_o_c_k after the tthheenn statement is executed. If not the _b_l_o_c_k after the eellssee is executed, if present. See _M_a_c_r_o_s for the definition of blocks. Early versions of this implementation of ggrraapp treated the blocks as macros that were defined and expanded in place. This led to unnecessary confusion because explicit separa- tors were sometimes called for. Now, ggrraapp inserts a separator (;) after the last character in _b_l_o_c_k, so constructs like if (x == 3) { y = y + 1 } x = x + 1 behave as expected. A separator is also appended to the end of a ffoorr block. ffoorr _n_a_m_e ffrroomm _f_r_o_m___e_x_p_r ttoo _t_o___e_x_p_r [bbyy [+|-|*|/] _b_y___e_x_p_r] ddoo _b_l_o_c_k This command executes _b_l_o_c_k iteratively. The variable _n_a_m_e is set to _f_r_o_m___e_x_p_r and incremented by _b_y___e_x_p_r until it exceeds _t_o___e_x_p_r. The iteration has the semantics defined in the ttiicckkss command. The definition of _b_l_o_c_k is discussed in _M_a_c_r_o_s. See also the note about implicit separators in the description of the iiff command. An == can be used in place of ffrroomm. EExxpprreessssiioonnss ggrraapp supports most standard arithmetic operators: + - / * ^. The carat (^) is exponentiation. In an iiff statement ggrraapp also supports the C logi- cal operators ==, !=, &&, || and unary !. Also in an iiff, == and != are overloaded for the comparison of quoted strings. Parentheses are used for grouping. Assignment is not allowed in an expression in any context, except for simple cascading of assignments. a = b = 35 works as expected; a = 3.5 * (b = 10) does not execute. ggrraapp supports the following functions that take one argument: lloogg, eexxpp, iinntt, ssiinn, ccooss, ssqqrrtt, rraanndd, fflloooorr, cceeiill. The logarithms are base 10 and the trigonometric functions are in radians. eeeexxpp returns Euler's number to the given power and llnn returns the natural logarithm. The natural log, exponentiation functions and floor and ceil are extensions and are probably not available in other ggrraapp implementations. rraanndd returns a random number uniformly distributed on [0,1). The follow- ing two-argument functions are supported: aattaann22, mmiinn, mmaaxx. aattaann22 works just like atan2(3). The random number generator can be seeded by calling ssrraanndd with a single parameter (converted internally to an integer). Be- cause its return value is of no use, you must use ssrraanndd as a separate statement, it is not part of a valid expression. ssrraanndd is not portable. The ggeettppiidd function takes no arguments and returns the process id. This may be used to seed the random number generator, but do not expect cryp- tographically random values to result. Other than string comparison, no expressions can use strings. One string valued function exists: sspprriinnttff (_f_o_r_m_a_t, [_e_x_p_r [_, _e_x_p_r]] ). It operates like sprintf(3), except returning the value. It can be used anywhere a quoted string is used. If ggrraapp is run with --SS, the environment variable GRAP_SAFER is defined, or ggrraapp has been compiled for safer operation, the sspprriinnttff command will return the format string. This mode of operation is only intended to be used only if ggrraapp is being used as part of a super- user enabled print system. ggrraapp version 1.44 and beyond support two functions for date and time ma- nipulation, ssttrrppttiimmee and ssttrrppttiimmee. ssttrrppttiimmee parses a time using the strptime(3) function. It takes two parameters, both strings, the format and a string to parse using that format and returns a number that can be sorted directly - the number of seconds since the UNIX epoch. ssttrrffttiimmee does the reverse. It takes a string and a number and formats the number into a date. In both functions, the format is the first parameter. The formats are defined in the documentation for strftime(3). MMaaccrrooss ggrraapp has a simple but powerful macro facility. Macros are defined using the ddeeffiinnee command : ddeeffiinnee _n_a_m_e _b_l_o_c_k uunnddeeffiinnee _n_a_m_e Every occurrence of _n_a_m_e in the program text is replaced by the contents of _b_l_o_c_k. _b_l_o_c_k is defined by a series of statements in nested { }'s, or a series of statements surrounded by the same let- ter. An example of the latter is define foo X coord x 1,3 X Each time foo appears in the text, it will be replaced by coord x 1,3. Macros are literal, and can contain newlines. If a macro does not span multiple lines, it should end in a semicolon to avoid parsing errors. Macros can take parameters, too. If a macro call is followed by a parenthesized, comma-separated list the values starting with $1 will be replaced in the macro with the elements of the list. A $ not followed by a digit is left unchanged. This parsing is very rudimentary; no nesting or parentheses or escaping of commas is al- lowed. Also, there is no way to say argument 1 followed by a digit (${1}0 in sh(1)). The following will draw a line with slope 1. define foo { next at $1, $2 } for i from 1 to 5 { foo(i,i) } Macros persist across graphs. The file _/_u_s_r_/_l_o_c_a_l_/_s_h_a_r_e_/_g_r_a_p_/_g_r_a_p_._d_e_f_i_n_e_s contains simple macros for plot- ting common characters. The uunnddeeffiinnee command deletes a macro. See the directory _/_u_s_r_/_l_o_c_a_l_/_s_h_a_r_e_/_e_x_a_m_p_l_e_s_/_g_r_a_p for more examples of macros. Confirm the location of the examples directory using the --vv flag. NNuummbbeerr LLiissttss A whitespace-separated list of numbers is treated specially. The list is taken to be points to be plotted using the default line style on the de- fault coordinate system. If more than two numbers are given, the extra numbers are taken to be additional y values to plot at the first x value. Number lists in DWB ggrraapp can be comma-separated, and this ggrraapp supports that as well. More precisely, numbers in number lists can be separated by either whitespace, commas, or both. 1 2 3 4 5 6 Will plot points using the default line style at (1,2), (1,3),(4,5) and (4,6). A simple way to plot a set of numbers in a file named _._/_d_a_t_a is: .G1 copy "./data" .G2 PPiicc MMaaccrrooss ggrraapp defines pic macros that can be used in embedded pic code to place elements in the graph. The macros are xx__gggg, yy__gggg, and xxyy__gggg. These macros define pic distances that correspond to the given argument. They can be used to size boxes or to plot pic constructs on the graph. To place a given construct on the graph, you should add Frame.Origin to it. Other coordinate spaces can be used by replacing gggg with the name of the coordinate space. A coordinate space named gggg cannot be reliably ac- cessed by these macros. The macros are emitted immediately before the frame is drawn. DWB ggrraapp may use these as part of its implementation. This ggrraapp provides them only for compatibility. Note that these are very simple macros, and may not do what you expect under complex conditions. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS If the environment variable GRAP_DEFINES is defined, ggrraapp will look for its defines file there. If that value is a relative path name the path specified in the --MM option will be searched for it. GRAP_DEFINES over- rides the compiled in location of the defines file, but may be overridden by the --dd or --DD flags. If GRAP_SAFER is set, sspprriinnttff is disabled to prevent forcing ggrraapp to core dump or smash the stack. FFIILLEESS _/_u_s_r_/_l_o_c_a_l_/_s_h_a_r_e_/_g_r_a_p_/_g_r_a_p_._d_e_f_i_n_e_s SSEEEE AALLSSOO atan2(3), groff(1), pic(1), printf(3), sh(1), sprintf(3), troff(1) If documentation and examples have been installed, ggrraapp ----vveerrssiioonn or ggrraapp ----hheellpp will display the locations. BBUUGGSS There are several small incompatibilities with K&R ggrraapp. They include the sshh command not expanding variables and macros, and a more strict ad- herence to parameter order in the internal commands. Although much improved, the error reporting code can still be confused. Notably, an error in a macro is not detected until the macro is used, and it produces unusual output in the error message. Iterating many times over a macro with no newlines can run ggrraapp out of memory. AAUUTTHHOORR This implementation was done by Ted Faber . Bruce Lilly contributed many bug fixes, including a considerable revamp of the error reporting code. If you can actually find an error in your ggrraapp code, you can probably thank him. ggrraapp was designed and specified by Brian Kernighan and Jon Bentley. BSD March 11, 2006 BSD grap-1.49/grap_parse.cc0000664000175000017500000006325015000074740011760 00000000000000/* -*-c++-*- */ /* This code is (c) 1998-2001 Ted Faber (faber@lunabase.org) see the COPYRIGHT file for the full copyright and limitations of liabilities. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #if defined(STDC_HEADERS) | defined(HAVE_STDLIB_H) #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_OPTARG extern "C" { extern char *optarg; extern int optind; int getopt(int, char * const [], const char *); }; #endif #include "grap.h" #include "grap_data.h" #include "grap_draw.h" #include "grap_pic.h" #include "y.tab.h" extern doubleDictionary vars; extern stringSequence path; extern graph *the_graph; extern bool unaligned_default; // Should strings be unaligned by default extern bool clip_default; // Should strings be clipped by default extern bool print_lex_debug; extern line* defline; extern coord *defcoord; bool compat_mode=false; // Compatibility mode #ifdef GRAP_SAFER bool do_sprintf = false; // Allow sprintf #else bool do_sprintf = true; // Allow sprintf #endif // defined in grap_lex.l extern int include_string(string *, for_descriptor *f=0, grap_input i=GMACRO); extern string pre_context(void); extern char *token_context(void); extern string post_context(void); extern bool include_file(string *, bool =false, bool=true); extern void init_keywords(); extern int yyparse(); extern int nlines; extern macroDictionary macros; const char *opts = "d:lDvuM:CVhScRr"; // Coarse defaults for double tolerances because these work best for common // cases - comparisons of fairly large values that don't differ by much. double epsilon = COARSE_EPSILON; double min_double = COARSE_MIN_DOUBLE; // Classes for various for_each calls // This collects the modifiers for other strings in // a string list to construct the modifiers for the next string class modaccumulator : public unary_function { public: int just; double size; int rel; bool clip; string *color; modaccumulator() : just(0), size(0), rel(0), clip(true), color(0) {}; int operator()(DisplayString* s) { just = s->j; size = s->size; rel = s->relsz; clip = s->clip; delete color; color = s->color; return 0; } }; // Add a tick to the graph class add_tick_f : public unary_function { sides side; double size; shiftlist shift; public: add_tick_f(sides sd, double sz, shiftlist *s) : side(sd), size(sz), shift() { shiftcpy sc(&shift); for_each(s->begin(), s->end(), sc); }; int operator()(tick *t) { shiftcpy sc(&t->shift); t->side = side; t->size = size; for_each(shift.begin(), shift.end(), sc); the_graph->base->tks.push_back(t); if ( t->side == top_side || t->side == bottom_side ) t->c->newx(t->where); else t->c->newy(t->where); return 0; } }; // Allocate a new graph (at this point always a Picgraph. This is // here so we don't have to include grap_pic in grap.y. graph *initial_graph() { return (graph *) new Picgraph; } // Combine a pair of line descriptions. Non-defaults in elem override // those features in desc. The function returns desc and frees elem, // so the programmer can treat it as freeing its parameters and // returning a new linedesc. (desc and elem should have been // allocated by new). linedesc* combine_linedesc(linedesc *desc, linedesc* elem) { if ( elem->ld != def ) { desc->ld = elem->ld; desc->param = elem->param; } if ( elem->fill ) desc->fill = elem->fill; if ( elem->thick ) desc->thick = elem->thick; if ( elem->color ) { if ( desc->color ) delete desc->color; desc->color = elem->color; // Don't let the destructor delete the color in desc. elem->color = 0; } if ( elem->fillcolor ) { if ( desc->fillcolor ) delete desc->fillcolor; desc->fillcolor = elem->fillcolor; // Don't let the destructor delete the fillcolor // in desc. elem->fillcolor = 0; } delete elem; return desc; } // Process a draw statement. Create a new line description if this is // a new name, assign the line description to it, and a plot string if // necessary. void draw_statement(string *ident, linedesc *ld, DisplayString *plot) { line *l; lineDictionary::iterator li; linedesc defld(invis,0,0); bool extant = false; // True if this line was already defined. if ( ident ) { li = the_graph->lines.find(*ident); if ( li == the_graph->lines.end() ) { if ( *ident == "grap_internal_default") defline = l = new line(); else l = new line(*defline); the_graph->lines[*ident] = l; } else { l = (*li).second; extant = true; } } else { l = defline; // This is a bit of a kludge. Don't reset any parameters of // the default line if new is given alone. if ( !ld && !plot ) extant = true; } // If a linedesc is specified, set the current line's description. if ( ld ) l->desc = *ld; if ( plot ) { if ( *plot != "" ) { delete l->plotstr; l->plotstr = new DisplayString(*plot); } else { // If the string is "", don't issue the pic commands to // print it. if (l->plotstr) { delete l->plotstr; l->plotstr = 0; } } } else { // Only delete the plot string if this is the line definition. // (This makes draw solid do what's expected.) To remove a // plot string, the user will have to explicitly specify an // empty plot string. if ( !extant ) { delete l->plotstr; l->plotstr = 0; } } l->lastplotted(0); delete ident; delete plot; delete ld; } // Process a line of a number list. dl is a list of numbers on this // line. If if at least an x and y are there, add those points to the // current line and coords. If only one number is given, use the // number of lines processed so far as the x value and the given // number as the y. void num_list(doublelist *dl) { double x, y; if ( dl->empty() ) exit(20); else { x = dl->front(); dl->pop_front(); } if ( dl->empty() ) { the_graph->new_linesegment(nlines, x, defcoord, defline); } else { while ( !dl->empty() ) { y = dl->front(); dl->pop_front(); the_graph->new_linesegment(x, y, defcoord, defline); } } delete dl; nlines++; } // Assign the double to the variable named by ident. If no such // variable exists, create it. double assignment_statement(string *ident, double val) { double *d; doubleDictionary::iterator di; if ( ( di = vars.find(*ident)) != vars.end() ) { d = (*di).second; *d = val; } else { d = new double(val); vars[*ident] = d; } // XXX: Again, shouldn't this go away? delete ident; return *d; } // This collects the modifiers for other strings in the list to // construct the modifiers for the current string. stringlist *combine_strings(stringlist *sl, string *st, strmod &sm) { modaccumulator last; DisplayString *s; last = for_each(sl->begin(), sl->end(), modaccumulator()); // If unaligned_default is set, then treat unaligned // strings as unmodified strings if ( sm.just != (unaligned_default ? unaligned : 0) ) last.just = sm.just; if ( sm.size != 0 ) { last.size = sm.size; last.rel = sm.rel; } // If there is a color in the string modifier, it will be used to create // the new display string, otherwise if there is a color specified for an // earlier string use a copy of that string for the color to avoid freeing // that string twice. if ( sm.color ) last.color = sm.color; else if ( last.color ) last.color = new string(*last.color); s = new DisplayString(*st,last.just, last.size, last.rel, last.clip, last.color); delete st; sl->push_back(s); return sl; } // Create a new plot, that is a string created from a double, and add // it to the current graph. void plot_statement(double val, DisplayString *fmt, point *pt) { stringlist *seq = new stringlist; DisplayString *s; if ( fmt && do_sprintf ) { unquote(fmt); s = new DisplayString(val,fmt); } else s = new DisplayString(val); // Delete format whether or not we used it (delete on 0 is OK) delete fmt; quote(s); seq->push_back(s); the_graph->new_plot(seq,pt); } // Add a point to the current line (or the named line if ident is // non-0). It may also include a pointer to a linedesc, wich should be // passed on if non-0. void next_statement(string *ident, point *p, linedesc* ld) { line *l; lineDictionary::iterator li; if ( ident) { li = the_graph->lines.find(*ident); if ( li == the_graph->lines.end() ) { macroDictionary::iterator md; macro *m; DisplayString *s; // We need to create a new line with default parameters. // Initialize the line to be invisible with a bullet // plotting string. if ( ( md = macros.find("bullet")) != macros.end()) { m = (*md).second; string *ss = m->invoke(); s = new DisplayString(*ss); delete ss; } else s = new DisplayString("\"\\(bu\""); l = new line((linedesc *)0, s ); the_graph->lines[*ident] = l; delete s; } else { l = (*li).second; } } else l = defline; delete ident; if ( ld ) the_graph->new_linesegment(p->x, p->y, p->c, l, 0, ld); else the_graph->new_linesegment(p->x, p->y, p->c, l); delete p; delete ld; } // Create a new tick with the given format (if any) and add it to the // current ticklist (which we're creating as we go). If no such list // exists, create it. ticklist *ticklist_elem(double d, DisplayString *fmt, ticklist *tl) { tick *t = new tick(d,0,top_side,0, (shiftlist *) 0, 0); DisplayString *s; if ( fmt ) { unquote(fmt); s = new DisplayString(d, fmt); delete fmt; } else s = new DisplayString(d); t->prt = s; if ( !tl ) tl = new ticklist; tl->push_back(t); return tl; } // Convert a for description of a set of ticks into a list of ticks, // including the coordinate system to put the ticks in, the beginning // and ending ticks, a general increment descriptor (by) and a string // to format each tick value. Return the list. ticklist *tick_for(coord *c, double from, double to, bydesc by, DisplayString *rfmt) { tick *t; DisplayString *s; DisplayString *fmt; double idx; int dir; ticklist *tl; tl = new ticklist; if ( rfmt && do_sprintf) { unquote(rfmt); fmt = new DisplayString(*rfmt); delete rfmt; } else fmt = new DisplayString("%g"); if ( to - from >= 0 ) dir = 1; else dir = -1; idx = from; while ( (idx - to) *dir < epsilon ) { t = new tick(idx, 0, top_side, 0, (shiftlist *) 0, 0); t->c = c; s = new DisplayString(idx,fmt); t->prt = s; tl->push_back(t); switch (by.op ) { case PLUS: idx += by.expr; break; case MINUS: idx -= by.expr; break; case TIMES: idx *= by.expr; break; case DIV: idx /= by.expr; break; } } delete fmt; return tl; } // Process the most complicated form of tick description. Add a list // of ticks to the current graph. void ticks_statement(sides side, double dir, shiftlist *sl, ticklist *tl ) { shiftdesc *sd; shiftcpy sc(&the_graph->base->tickdef[side].shift); add_tick_f add_tick(side, dir, sl); the_graph->base->tickdef[side].side = side; for_each(sl->begin(), sl->end(), sc); if ( !tl || tl->empty() ) { the_graph->base->tickdef[side].size = dir; } else the_graph->base->tickdef[side].size = 0; if ( tl ) { for_each(tl->begin(), tl->end(), add_tick); delete tl; } while (!sl->empty()) { sd = sl->front(); sl->pop_front(); delete sd; } delete sl; } // Process a grid statement. This is similar to, but somewhat more // complex than the ticks statement above. void grid_statement(sides side, int ticks_off, linedesc *ld, shiftlist *sl, ticklist *tl) { tick *t; grid *g; linedesc defgrid(dotted, 0, 0); shiftcpy sc(&the_graph->base->griddef[side].shift); shiftdesc *sd; // Turning on a grid turns off default ticks on that side the_graph->base->tickdef[side].size = 0; // All grids have a linedesc, so create one if the user didn't // specify one. if ( !ld ) ld = new linedesc; // The default for grids is dotted if ( ld->ld == def ) ld->ld = dotted; the_graph->base->griddef[side].desc = *ld; for_each(sl->begin(), sl->end(), sc); if ( ticks_off ) { if ( the_graph->base->griddef[side].prt ) delete the_graph->base->griddef[side].prt; the_graph->base->griddef[side].prt = 0; } if ( tl ) { the_graph->base->griddef[side].desc.ld = def; while (!tl->empty() ) { t = tl->front(); tl->pop_front(); g = new grid(t); g->side = side; shiftcpy scy(&g->shift); if ( ld ) { // The default for grids is dotted if ( ld->ld == def ) ld->ld = dotted; g->desc = *ld; } for_each(sl->begin(), sl->end(), scy); if ( ticks_off ) { if ( g->prt ) delete g->prt; g->prt = 0; } the_graph->base->gds.push_back(g); if ( g->side == top_side || g->side == bottom_side ) g->c->newx(g->where); else g->c->newy(g->where); delete t; } delete tl; } while ( !sl->empty() ) { sd = sl->front(); sl->pop_front(); delete sd; } delete sl; delete ld; } // Draw a line from p1 to p2. If is_line is false, draw an error // instead. Either ld1 or ld2 or both may be present. If only one is // non-default, it rules, otherwise ld2 counts. void line_statement(int is_line, linedesc *ld1, point *p1, point *p2, linedesc *ld2 ) { line *l; lineDictionary::iterator li; // This constructor combines the two linedescs linedesc des(ld1, ld2); // Basically this should never fail... li = the_graph->lines.find("grap.internal"); if ( li == the_graph->lines.end() ) { if ( des.ld == def ) des.ld = solid; l = new line(&des); the_graph->lines["grap.internal"] = l; } else { l = (*li).second; } l->lastplotted(0); if ( des.ld != def || des.color) { the_graph->new_linesegment(p1->x, p1->y, p1->c, l, 0, &des); if ( is_line ) the_graph->new_linesegment(p2->x, p2->y, p2->c, l, 0, &des); else the_graph->new_linesegment(p2->x, p2->y, p2->c, l, 0, &des, true); } else { the_graph->new_linesegment(p1->x, p1->y, p1->c, l, 0, &des); if (is_line) the_graph->new_linesegment(p2->x, p2->y, p2->c, l, 0, &des); else the_graph->new_linesegment(p2->x,p2->y,p2->c, l, 0, &des, true); } delete ld1; delete ld2; delete p1; delete p2; } // Create an axis description. That is, tell which axis it is and the // bounds. axisdesc axis_description(axis which, double d1, double d2) { axisdesc a; a.which = which; if (d1 < d2 ) { a.min = d1; a.max = d2; } else { a.min = d2; a.max = d1; } return a; } // Create a coordinate object. Assign the mins and maxes to the axes // and tell which if any are logarithmic. void coord_statement(string *ident, axisdesc& xa, axisdesc& ya, axis log) { coord *c; if (ident) { c = new coord(*ident); the_graph->coords[*ident] = c; } else c = defcoord; if ( xa.which != none ) { c->xmin = xa.min; c->xmax = xa.max; c->xautoscale = 0; } if ( ya.which != none ) { c->ymin = ya.min; c->ymax = ya.max; c->yautoscale = 0; } c->logscale = log; } // Assign to an old coordinate object. Assign the mins and maxes to // the axes and tell which if any are logarithmic. void coord_statement(coord *co, axisdesc& xa, axisdesc& ya, axis log) { coord *c; if (co) c = co; else c = defcoord; if ( xa.which != none ) { c->xmin = xa.min; c->xmax = xa.max; c->xautoscale = 0; } if ( ya.which != none ) { c->ymin = ya.min; c->ymax = ya.max; c->yautoscale = 0; } if ( log != none ) c->logscale = log; } // Initiate a for statement by generating a for descriptor and // including the string. The body is captured by changing lex state // in the middle of the for_statement yacc rule. void for_statement(string *ident, double from, double to, bydesc by, string *body) { // force body to end with a sep *body += ';'; if ( fabs(to - from) < epsilon ) { // Limits are essentially the same, include the string once. The // routine will discard body. include_string(body,0,GINTERNAL); } else { // Determine if the loop is advancing from -> to. If not, it's a null // loop. double lim1 = to -from; // Initial difference double lim2 = from; // Difference after an iteration int dir = ( lim1 > -epsilon ) ? 1 : -1; // Make the differences positive switch (by.op ) { case PLUS: default: lim2 += by.expr; break; case MINUS: lim2 -= by.expr; break; case TIMES: lim2 *= by.expr; break; case DIV: lim2 /= by.expr; break; } lim2 = (to - lim2) * dir; lim1 *= dir; // If the loop is advancing toward the limit include the string. // Create a for descriptor and insert the string. Otherwise throw away // body if ( lim1 > lim2 ) { for_descriptor *f = 0; doubleDictionary::iterator di = vars.find(*ident); double *d = 0; if ( di != vars.end() ) { d = (*di).second; *d = from; } else { d = new double(from); vars[*ident] = d; } f = new for_descriptor(d, dir, to, by.expr, by.op, body); // include_string is responsible for deleting body (actually the // for_descriptor destructor will do it. include_string(body, f, GINTERNAL); } else delete body; } } void process_frame(linedesc* d, frame *f, frame *s) { // it's inconvenient to write three forms of the frame statement // as one yacc rule, so I wrote the three rules explicitly and // extracted the action here. The three arguments are the default // frame linedesc (d), the size of the frame (f), and individual // descriptions of the linedescs (s) of the sides. Note that d, // f, and s are freed by this routine. int i; // Scratch if ( d ) { // If the default linedesc has a description, color or thickness, // propagate it. if ( d->ld != def || d->color || d->thick != 0.0 ) { for ( i = 0 ; i < 4; i++ ) { the_graph->base->desc[i] = *d; } } delete d; } if ( f ) { the_graph->base->ht = f->ht; the_graph->base->wid = f->wid; delete f; } if ( s ) { for ( i = 0 ; i < 4; i++ ) { // If the linedesc has a description, color or thickness, propagate // it. if ( s->desc[i].ld != def || s->desc[i].color || s->desc[i].thick != 0.0 ) the_graph->base->desc[i] = (linedesc) s->desc[i]; } delete s; } } // Combine two log descriptions in a log list. Old is the accumulated // log state so far, and n is the latest state to merge. Return the // new combined state. The new state is created by making the n axis // a log axis if it is not already in that list. axis combine_logs(axis old, axis n) { switch (old) { default: case none: return n; case x_axis: switch (n) { case x_axis: case none: return x_axis; case y_axis: case both: default: return both; } case y_axis: switch (n) { case y_axis: case none: return y_axis; case x_axis: case both: default: return both; } case both: return both; } } // If a macro with the given name is defined, redefine it to be text, // otherwise create a new macro and define it to be text. void define_macro(string *name, string *text) { macro *m; // The new macro macroDictionary::iterator mi; // To search defined macros if ( ( mi = macros.find(*name)) != macros.end() ) { m = (*mi).second; delete m->text; m->text = text; } else { m = new macro(text, name); macros[*name] = m; } } // Create a new bar with the given parameters and add it to the graph. void bar_statement(coord *c, sides dir, double offset, double ht, double wid, double base, linedesc *ld) { point *p1, *p2; // The defining points of the box switch (dir) { case right_side: p1 = new point(base, offset + wid/2, c); p2 = new point(base + ht, offset - wid/2, c); break; case top_side: default: p1 = new point(offset + wid/2, base, c); p2 = new point(offset - wid/2, base + ht, c); break; } c->newpt(p1->x,p1->y); c->newpt(p2->x,p2->y); the_graph->new_box(p1, p2, ld); delete p1; delete p2; delete ld; } // Perhaps a misnomer. Initialize the current frame default lines and // coordinate systems. The default line is initialized to be // invisible and have a plotting string defined by the bullet macro, // if it is defined or a bullet character if not. void init_dict() { // The plot string for the default line string s = (macros.find("bullet") != macros.end()) ? "bullet;" : "\"\\(bu\";\n"; s.insert(0,"new grap_internal_default invis "); include_string(&s, 0, GINTERNAL); defline = new line(); the_graph->lines["grap_internal_default"] = defline; defcoord = new coord; the_graph->coords["grap.internal.default"] = defcoord; for ( int i = 0 ; i < 4; i++) { the_graph->base->tickdef[i].c = defcoord; the_graph->base->griddef[i].c = defcoord; } nlines = 0; } int yyerror(const char *s) { grap_buffer_state *g = 0; cerr << "grap: " << s << endl; while ( !lexstack.empty() ) { g = lexstack.front(); lexstack.pop_front(); switch ( g->type) { case GFILE: cerr << "Error near line " << g->line << ", " ; if ( g->name ) cerr << "file \"" << *g->name << "\"" << endl; break; case GMACRO: cerr << "Error near line " << g->line << " " ; cerr << "of macro" << endl; break; default: break; } delete g; } cerr << " context is:" << endl << " " << pre_context(); cerr << " >>> " << token_context() << " <<< " << post_context() << endl; return 0; } void usage() { cerr << "Usage: grap [-d defines] [-h|-l|-D|-V|-v|-u|-C|-S] " << "[-M path] [files]" << endl; cerr << "\t-h\tprint this list and exit (also --help)" << endl; cerr << "\t-C\tcompatibility mode" << endl; cerr << "\t-c\tdefault to not clipping lines" << endl; cerr << "\t-d\tuse given defines file" << endl; cerr << "\t-D\tuse no defines file" << endl; cerr << "\t-l\tuse no defines file" << endl; cerr << "\t-R\tuse coarse numeric comparisons (default)" << endl; cerr << "\t-r\tuse fine numeric comparisons" << endl; cerr << "\t-v\tprint version and exit (also --version)" << endl; cerr << "\t-V\tprint parse debugging information" << endl; cerr << "\t-u\tforce graph labels to be unaligned by default" << endl; cerr << "\t-M\tspecify search path for files" << endl; cerr << "\t-S\tsafer mode, no internal user sprintf calls" << endl; cerr << endl; cerr << "Fine comparison limit: " << FINE_EPSILON << endl; cerr << "Fine minimum value: " << FINE_MIN_DOUBLE << endl; cerr << "Coarse comparison limit: " << COARSE_EPSILON << endl; cerr << "Coarse minimum value: " << COARSE_MIN_DOUBLE << endl; cerr << "Defines are in " << DEFINES << endl; cerr << "See the man page for more information." << endl; cerr << "Documentation in " << DOCS_DIR << endl; cerr << "Examples in " << EXAMPLES_DIR << endl; exit(5); } inline void version() { cout << "grap " << PACKAGE_VERSION << " compiled under " << OS_VERSION << endl; cerr << "Fine comparison limit: " << FINE_EPSILON << endl; cerr << "Fine minimum value: " << FINE_MIN_DOUBLE << endl; cerr << "Coarse comparison limit: " << COARSE_EPSILON << endl; cerr << "Coarse minimum value: " << COARSE_MIN_DOUBLE << endl; cout << "Report bugs to " << PACKAGE_BUGREPORT << endl; cout << "Documentation in " << DOCS_DIR << endl; cout << "Examples in " << EXAMPLES_DIR << endl; cout << "Defines are in " << DEFINES << endl; exit(5); } int main(int argc, char** argv) { string defines=DEFINES; string fname; string pathstring; bool use_defines = true; int c; if (getenv("GRAP_DEFINES")) defines = getenv("GRAP_DEFINES"); if ( getenv("GRAP_SAFER") ) do_sprintf = false; // Either of these long options are recognized to make the GNU folks // happier. for (int i = 1; i< argc; i++ ) { string av(argv[i]); if ( av == "--version" ) version(); else if ( av == "--help" ) usage(); } while ( ( c = getopt(argc,argv,opts)) != -1) switch (c) { case 'd': defines = optarg; use_defines = true; break; case 'l': case 'D': use_defines = false; break; case 'v': version(); break; case 'V': print_lex_debug = true; break; case 'u': unaligned_default = 1; break; case 'M': pathstring = (pathstring + ":") + optarg; break; case 'c': clip_default = false; break; case 'C': clip_default = false; compat_mode = true; break; case 'S': do_sprintf = false; break; case 'R': epsilon = COARSE_EPSILON; min_double = COARSE_MIN_DOUBLE; break; case 'r': epsilon = FINE_EPSILON; min_double = FINE_MIN_DOUBLE; break; case 'h': case '?': usage(); break; } pathstring += (pathstring.length() > 0) ? ":." : "."; // Convert the colon separated file path into a sequence while (pathstring.length()) { string::size_type p = pathstring.find(':'); string *s; if ( p != string::npos && pathstring[p] == ':' ) { if ( p != 0 ) { s = new string(pathstring.substr(0,p)); pathstring.erase(0,p+1); } else { pathstring.erase(0,1); continue; } } else { s = new string(pathstring); pathstring.erase(0,string::npos); } path.push_back(s); } init_keywords(); if ( argc == optind ) { fname = "-"; include_file(&fname, true, false); } else { for ( int i = argc-1; i >= optind; i-- ) { fname = argv[i]; include_file(&fname, true, false); } } if ( use_defines) include_file(&defines, true); yyparse(); for (stringSequence::iterator ii = path.begin(); ii != path.end(); ii++) delete (*ii); path.erase(path.begin(),path.end()); } grap-1.49/grap.m40000664000175000017500000001741114546364223010533 00000000000000dnl a lower case to upper case utility function define(tvf_upper,[translit($1,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ)]) dnl set the variable in the first argument to the value in the second if dnl the c++ compiler is a GNU compiler. Export the variable as a substitution AC_DEFUN([TVF_PROG_GXX_SUBST],[ AC_REQUIRE([AC_PROG_CXX]) # Set g++ specific compiler options if test "$GXX" = "yes" ; then $1="$2" else $1="" fi AC_SUBST($1) ]) dnl set the variable in the first argument to the value in the second if dnl the C compiler is a GNU compiler AC_DEFUN([TVF_PROG_GCC_SUBST],[ AC_REQUIRE([AC_PROG_CC]) # Set g++ specific compiler options if test "$GCC" = "yes" ; then $1="$2" else $1="" fi AC_SUBST($1) ]) dnl if the install doesn't handle -d properly, fall back to the install script AC_DEFUN([TVF_PROG_INSTALL_D],[ AC_REQUIRE([AC_PROG_INSTALL]) AC_CACHE_CHECK(whether $INSTALL supports -d, tvf_cv_prog_install_d, if $INSTALL -d /tmp/test$$ && test -d /tmp/test$$ ; then tvf_cv_prog_install_d="yes" else tvf_cv_prog_install_d="no" fi rm -rf /tmp/test$$ ) if test "$tvf_cv_prog_install_d" = "no" ; then INSTALL=$ac_install_sh fi ]) dnl check for various methods of making dependencies, from the mkdep dnl script to copying precomputed defaults. Both MKDEP and MKDEPFLAGS are dnl set and seported via AC_SUBST AC_DEFUN([TVF_PROG_MKDEP],[ AC_CHECK_PROGS(MKDEP,mkdep gcc, cp) define(tvf_extra_flags,$1) # depending on which mkdep method has been found, the args are # slightly different. -f is redundant on FreeBSD, but needed other places. # The test for that is completely superfluous. if test $ac_ext = "C" || test $ac_ext = "cc" ; then tvf_compflags='${CXXFLAGS}' tvf_mk_gcc=g++ tvf_mk_include="" else tvf_compflags='${CFLAGS}' tvf_mk_gcc=gcc tvf_mk_include="" fi # make sure that mkdep plays well with others. Be careful. Bad mkdep # implementations are very cranky about parameter order. if test "$MKDEP" = mkdep; then tvf_here=`pwd` cd /tmp mkdir test.$$ cd test.$$ # solaris mkdep wants a .depend there already touch .depend touch test.h cat > test.$ac_ext << END #include $tvf_mk_include #include "test.h" int main(int argc, char **argv) { } END $MKDEP -f .depend tvf_extra_flags -MM test.$ac_ext 2> /dev/null > /dev/null grep test.h .depend > /dev/null 2>&1 if test "$?" != "0"; then # MKDEP does not play well with us, use gcc or cp cd $tvf_here unset ac_cv_prog_MKDEP unset MKDEP AC_CHECK_PROGS(MKDEP,gcc, cp) else cd $tvf_here fi rm -rf /tmp/test.$$ fi case "$MKDEP" in mkdep) if test `uname` = 'FreeBSD'; then MKDEPFLAGS="tvf_extra_flags -MM $tvf_compflags \${SOURCES}" else MKDEPFLAGS="-f .depend tvf_extra_flags -MM $tvf_compflags \${SOURCES}" fi ;; gcc) MKDEP=$tvf_mk_gcc MKDEPFLAGS="-MM $tvf_compflags \${SOURCES} >> .depend" ;; cp) MKDEPFLAGS='default_depend .depend' ;; esac undefine([tvf_extra_flags]) AC_SUBST(MKDEPFLAGS) ]) dnl See if the given function is both present and declared. The first dnl argument is the function to check, the second is a space separated dnl list of headers to check and the last is an optional CHECK or REPLACE dnl that determines whether AC_CHECK_FUNCS or AC_REPLACE_FUNCS is called dnl internally. Both the usual HAVE_function and function_DECLARED are dnl AC_DEFINEd. AC_DEFUN([TVF_FUNC_DECL],[ define(tvf_call,[AC_]ifelse($3,,CHECK,$3)[_FUNCS(]$1[)]) tvf_call if test "$ac_cv_func_$1" = "yes" ; then AC_CACHE_CHECK(for declaration of $1,tvf_cv_decl_$1, for f in $2; do AC_EGREP_HEADER($1,$f,tvf_cv_decl_$1="yes", tvf_cv_decl_$1="no") if test $tvf_cv_decl_$1 = "yes"; then break; fi done ) if test "$tvf_cv_decl_$1" = "yes"; then AC_DEFINE(tvf_upper($1)_DECLARED) fi fi undefine([tvf_call]) ]) dnl see if optarg is defined in unistd.h and cache the result. dnl OPTARG_DEFINED is set if optarg is found. AC_DEFUN([TVF_DECL_OPTARG],[ if test "$ac_cv_header_unistd_h" = "yes" ; then AC_CACHE_CHECK(for optarg in unistd.h,tvf_cv_header_optarg, AC_EGREP_HEADER(optarg,unistd.h,tvf_cv_header_optarg="yes"; ,tvf_cv_header_optarg="no")) if test "$tvf_cv_header_optarg" = "yes"; then AC_DEFINE(OPTARG_DEFINED) fi fi ]) dnl see the sh comment AC_DEFUN([TVF_CREATE_DOT_DEPEND],[ AC_MSG_RESULT(creating default depend file) # Create an empty .depend that is older than Makefile # if touch will take a time, set the time explicitly, # if not wait a bit so that the created Makefile is newer if test "$MKDEP" = "cp" ; then cp default_depend .depend else cat < /dev/null > .depend touch -t 9912311000 .depend > /dev/null 2>&1 || sleep 1 fi ]) dnl get the OS version. Export it as OS_VERSION in an AC_SUBST AC_DEFUN([TVF_OS_VERSION],[ AC_CACHE_CHECK(for OS version,tvf_cv_os_version, tvf_cv_os_version=`uname -sr` ) OS_VERSION=$tvf_cv_os_version AC_SUBST(OS_VERSION) AC_DEFINE_UNQUOTED(OS_VERSION,"$OS_VERSION") ]) dnl determine if $MAKE uses .ifdef or ifdef . If one of these choices dnl works, the output variables MAKE_IFDEF, MAKE_IFNDEF, MAKE_ELSE, dnl and MAKE_ENDIF are set to appropriate values. If the routine dnl can't tell which ones to use, the output variables are defined as dnl comment characters. Can be overridden with --enable-make-ifdef=. AC_DEFUN([TVF_MAKE_IFDEF], [ AC_ARG_ENABLE(make-ifdef, [ --enable-make-ifdef=X set the string format used for ifdef in Makefiles either .ifdef, ifdef or no ], [ AC_MSG_CHECKING([make ifdef directive]) tvf_cv_make_ifdef=$enableval AC_MSG_RESULT($tvf_cv_make_ifdef (arg)) ], AC_CACHE_CHECK([make ifdef directive],tvf_cv_make_ifdef, tvf_cv_make_ifdef="no" tvf_here=`pwd` cd /tmp mkdir make.$$ cd make.$$ cat > Makefile < /dev/null 2> /dev/null && \ test -e ./test ; then tvf_cv_make_ifdef="ifdef" else rm -f test cat > Makefile < /dev/null 2>/dev/null \ && test -e ./test ; then tvf_cv_make_ifdef=".ifdef" fi fi cd /tmp rm -rf make.$$ cd $tvf_here )) case $tvf_cv_make_ifdef in no) MAKE_IFDEF='# ifdef' MAKE_IFNDEF='# ifndef' MAKE_ELSE='# else' MAKE_ENDIF='# endif' ;; .ifdef) MAKE_IFDEF='.ifdef' MAKE_IFNDEF='.ifndef' MAKE_ELSE='.else' MAKE_ENDIF='.endif' ;; ifdef) MAKE_IFDEF='ifdef' MAKE_IFNDEF='ifndef' MAKE_ELSE='else' MAKE_ENDIF='endif' ;; esac AC_SUBST(MAKE_IFDEF) AC_SUBST(MAKE_IFNDEF) AC_SUBST(MAKE_ELSE) AC_SUBST(MAKE_ENDIF) ]) dnl determine if the -mdoc macros are available. Export them into MAN_MACROS. AC_DEFUN([TVF_MAN_MACROS],[ AC_CACHE_CHECK(for manpage macros, tvf_cv_man_macros,[ if troff -mdoc < /dev/null > /dev/null 2> /dev/null; then tvf_cv_man_macros=doc else tvf_cv_man_macros=an fi ]) MAN_MACROS=$tvf_cv_man_macros AC_SUBST(MAN_MACROS) ]) dnl test a 3-place version number. The first is the actual version, dnl the second the limit. The third is the program name AC_DEFUN([TVF_CHECK_VERSION_THREE],[ changequote(<<,>>) tvf_lim_major=`echo "$2" | sed 's/\..*//'` tvf_lim_minor=`echo "$2" | sed 's/[^\.]*\.\([^.]*\)\..*/\1/'` tvf_lim_three=`echo "$2" | sed 's/[^\.]*\.[^.]*\.\(.*\)/\1/'` tvf_act_major=`echo "$1" | sed 's/\..*//'` tvf_act_minor=`echo "$1" | sed 's/[^\.]*\.\([^.]*\)\..*/\1/'` tvf_act_three=`echo "$1" | sed 's/[^\.]*\.[^.]*\.\(.*\)/\1/'` changequote([,]) define([tvf_ok],ifelse("$3","",[true],$3)) define([tvf_bad],ifelse("$4","",[true],$4)) if test $tvf_act_major -lt $tvf_lim_major ; then tvf_bad else if test $tvf_act_major -eq $tvf_lim_major && \ test $tvf_act_minor -lt $tvf_lim_minor ; then tvf_bad else if test $tvf_act_major -eq $tvf_lim_major && \ test $tvf_act_minor -eq $tvf_lim_minor &&\ test $tvf_act_three -lt $tvf_lim_three; then tvf_bad else tvf_ok fi fi fi undefine([tvf_ok]) undefine([tvf_bad]) ]) grap-1.49/AUTHORS0000664000175000017500000000002314546364223010377 00000000000000faber@lunabase.org grap-1.49/grap.h0000664000175000017500000001257414546364223010447 00000000000000// -*-c++-*- #ifndef GRAP_H #define GRAP_H // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. #ifndef DEFINES #define DEFINES "/usr/share/grap/grap.defines" #endif #ifndef STDC_HEADERS extern "C" { #ifndef __GNUC__ size_t strlen(const char*); char *strcpy(char *, const char *); int strcmp(const char *, const char *); #endif char *strcat(char *, const char *); char *strncpy(char *, const char *, const size_t); int strncmp(const char *, const char *, const size_t); }; #endif #ifndef HAVE_SNPRINTF #include "snprintf.h" #else // AIX seems to have snprintf, but not prototype it.. #ifndef SNPRINTF_DECLARED extern "C" { int snprintf(char *, size_t, const char *, ...); } #endif #endif using namespace std; #include #include #include #include class DisplayString; class line; class coord; class macro; class plot; class tick; class grid; class circle; class shiftdesc; class keyword; #if HAVE_HASH_MAP||HAVE_EXT_HASH_MAP||HAVE_UNORDERED_MAP #ifdef HAVE_UNORDERED_MAP #include typedef HASH_SPACE::unordered_map doubleDictionary; typedef HASH_SPACE::unordered_map coordinateDictionary; typedef HASH_SPACE::unordered_map lineDictionary; typedef HASH_SPACE::unordered_map macroDictionary; typedef HASH_SPACE::unordered_map keywordDictionary; #else #ifdef HAVE_HASH_MAP #include #else #include #endif // A functor for hashing strings - it is an adapter to get to the // standard library char * hash function. class Strhash : public unary_function { private: HASH_SPACE::hash h; public: size_t operator()(const string& s) const { return h(s.c_str()); } }; typedef HASH_SPACE::hash_map doubleDictionary; typedef HASH_SPACE::hash_map coordinateDictionary; typedef HASH_SPACE::hash_map lineDictionary; typedef HASH_SPACE::hash_map macroDictionary; typedef HASH_SPACE::hash_map keywordDictionary; #endif #else #include typedef less Strcmp; typedef map doubleDictionary; typedef map coordinateDictionary; typedef map lineDictionary; typedef map macroDictionary; typedef map keywordDictionary; #endif typedef list plotSequence; typedef vector doublevec; typedef list doublelist; typedef list ticklist; typedef list gridlist; typedef list linelist; typedef list stringSequence; typedef list circleSequence; typedef list lexStack; typedef list stringlist; typedef list shiftlist; // number of functions taking 0,1,2 args. The names of those // functions are in grap_lex.l and the implementations in the // jumptables in grap.y const int NVF1=1; const int NF0=2; const int NF1=10; const int NF2=3; enum size { ht = 0, wid}; typedef struct { int op; double expr; } bydesc; // this is complex enough to need a constructor/destructor class for_descriptor { public: double *loop_var; int dir; double limit; double by; int by_op; string *anything; for_descriptor() : loop_var(0), dir(0), limit(0.0), by(0.0), by_op(0), anything(0) { } for_descriptor(double *lv, int d, double l, double b, int bo, string *a) : loop_var(lv), dir(d), limit(l), by(b), by_op(bo), anything(a) { } ~for_descriptor() { if ( anything) { delete anything; anything = 0; } } }; typedef enum { GFILE=1, GMACRO, GINTERNAL } grap_input; class grap_buffer_state { public: struct yy_buffer_state *yy; for_descriptor *f; string *name; int line; int report_start; grap_input type; int tokenpos; grap_buffer_state() : yy(0), f(0), name(0), line(0), report_start(0), type(GFILE), tokenpos(0) { } grap_buffer_state(struct yy_buffer_state *yyb, for_descriptor *fo, string *n, int l, int rs, grap_input t, int tp=0) : yy(yyb), f(fo), name(n), line(l), report_start(rs), type(t), tokenpos(tp) { } // this does *not* call yy_delete_buffer ~grap_buffer_state() { if ( f ) { delete f; f = 0; } if ( name ) { delete name; name = 0; } } }; extern lexStack lexstack; // Set the coarse and fine limits for double comparisons. COARSE comparisons // are always within one millionth. If fine comparisons are requested, either // the values in limits are used or one trillionth (1e-12). #ifdef HAVE_LIMITS #include #define FINE_EPSILON numeric_limits::epsilon() #define FINE_MIN_DOUBLE numeric_limits::min() #define COARSE_EPSILON 1e-6 #define COARSE_MIN_DOUBLE 1e-6 #else #define FINE_EPSILON 1e-12 #define FINE_MIN_DOUBLE 1e-12 #define COARSE_EPSILON 1e-6 #define COARSE_MIN_DOUBLE 1e-6 #endif extern double epsilon; extern double min_double; #ifdef HAVE_RANDOM #ifndef RANDOM_DECLARED extern "C" { long random(); void srandom(unsigned long); } #endif #else #ifdef HAVE_RAND #define random rand #define srandom srand #ifndef RAND_DECLARED extern "C" { long rand(); void srand(unsigned); } #endif #endif #endif #endif grap-1.49/INSTALL0000664000175000017500000000001314546364223010357 00000000000000See README grap-1.49/missing0000755000175000017500000001533614215102164010724 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: grap-1.49/grap.spec0000664000175000017500000000310114546364223011134 00000000000000# -*-rpm-spec-*- %define version 1.47 Summary: grap, typesets graphs for groff Name: grap Version: %{version} Release: 1 License: BSD Group: Applications/Publishing Source0: ./grap-%{version}.tar.gz %description This is grap, an implementation of Kernighan and Bentley\'s grap language for typesetting graphs. %prep %setup -q %build ./configure --prefix=%{buildroot}%{_prefix} --mandir=%{buildroot}%{_prefix}/share/man make %install make install %files %doc README %doc COPYRIGHT %doc CHANGES %dir %{_prefix}/share/grap/ %dir %{_prefix}/share/examples/grap/ %dir %{_prefix}/share/doc/grap/ %{_prefix}/bin/grap %{_prefix}/share/man/man1/grap.1.gz %{_prefix}/share/doc/grap/grap.man %{_prefix}/share/examples/grap/400mpairs.d %{_prefix}/share/examples/grap/400mtimes.d %{_prefix}/share/examples/grap/400wpairs.d %{_prefix}/share/examples/grap/Makefile %{_prefix}/share/examples/grap/army.d %{_prefix}/share/examples/grap/boyhts.d %{_prefix}/share/examples/grap/cy_fatal.d %{_prefix}/share/examples/grap/example.ms %{_prefix}/share/examples/grap/internet.d %{_prefix}/share/examples/grap/prof2.d %{_prefix}/share/examples/grap/result.SQ_MESH.Fail1.S3.R0.Global.Random1500.succ.result %{_prefix}/share/examples/grap/result.SQ_MESH.Fail1.S3.R0.Hybrid.Random1500.succ.result %{_prefix}/share/examples/grap/result.SQ_MESH.Fail1.S3.R0.Local.Random1500.succ.result %{_prefix}/share/examples/grap/states.d %{_prefix}/share/examples/grap/states2.d %{_prefix}/share/examples/grap/states3.d %{_prefix}/share/examples/grap/usapop.d %{_prefix}/share/grap/grap.defines %{_prefix}/share/grap/grap.tex.defines grap-1.49/strerror.cc0000664000175000017500000000021014546364223011516 00000000000000#include char *strerror(int errnum) { static char rv[100]; sprintf(rv, "error number %d", errnum); return rv; } grap-1.49/examples/0000775000175000017500000000000015000076444011221 500000000000000grap-1.49/examples/states.d0000664000175000017500000000123014546364223012616 00000000000000WY 1 453588 AK 1 550043 VT 1 562758 ND 1 638800 DE 1 666168 SD 1 696004 MT 1 799065 RI 2 1003464 ID 2 1006749 HI 2 1108229 NH 2 1109252 NV 2 1201833 ME 2 1227928 NM 3 1515069 NE 3 1578385 UT 3 1722850 WV 3 1793477 AR 4 2350725 KS 4 2477574 MS 5 2573216 IA 5 2776755 OR 5 2842321 OK 6 3145585 CT 6 3287116 CO 6 3294394 SC 6 3486703 AZ 6 3665228 KY 6 3685296 AL 7 4040587 LA 7 4219973 MN 8 4375099 MD 8 4781468 WA 8 4866692 TN 9 4877185 WI 9 4891769 MO 9 5117073 IN 10 5544159 MA 11 6016425 VA 11 6187358 GA 11 6478216 NC 12 6628637 NJ 13 7730188 MI 16 9295297 OH 19 10847115 IL 20 11430602 PA 21 11881643 FL 23 12937926 TX 30 16986510 NY 31 17990455 CA 52 29760021 grap-1.49/examples/400mpairs.d0000664000175000017500000000034014546364223013033 000000000000001896 54.2 1900 49.4 1904 49.2 1908 50 1912 48.2 1920 49.6 1924 47.6 1928 47.8 1932 46.2 1936 46.5 1948 46.2 1952 45.9 1956 46.7 1960 44.9 1964 45.1 1968 43.8 1972 44.66 1976 44.26 1980 44.60 1984 44.27 1988 43.87 1992 43.50 grap-1.49/examples/cy_fatal.d0000664000175000017500000000031714546364223013102 000000000000001983 839 794 1984 849 814 1985 890 820 1986 941 886 1987 948 922 1988 911 859 1989 832 776 1990 859 814 1991 843 794 1992 723 679 1993 816 789 1994 802 730 1995 833 783 1996 765 695 1997 814 -1 1998 761 -1 grap-1.49/examples/internet.d0000664000175000017500000000020114546364223013140 0000000000000081 213 83 562 85 1961 87 28174 89 159000 90 313000 91 617000 92 1136000 93 2056000 94 3864000 95 6642000 96 12881000 97 19540000 grap-1.49/examples/example.ms0000664000175000017500000017167314546364223013165 00000000000000.\" This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT .\" for the full copyright and limitations of liabilities. .EQ delim $$ .EN .PP This is a collection of example graphs that are mostly taken from Bentley and Kernighan's paper on .I grap that is referenced from the manual page. Please check that for an explanation of the graphs' meaning. I use them primarily as a regression test suite. .PP Each graph is accompanied by a brief description and the .I grap code that produced it. .KS .PP A simple copy. The data is the winning time for the mens' 400m run taken from the Pittsburgh Press's .I 1994 World Almanac and Book of Facts. .R .EQ delim off .EN .DS .ft CW \&.G1 \© "400mtimes.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 copy "400mtimes.d" .G2 .KE .KS .PP A simple copy with both $x$ and $y$ coordinates. The data is from the same source, but includes the year. .EQ delim off .EN .DS .ft CW \&.G1 \© "400mpairs.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 copy "400mpairs.d" .G2 Simple connection of points. Same data. .EQ delim off .EN .DS .ft CW \&.G1 \&draw solid \© "400mpairs.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 draw solid copy "400mpairs.d" .G2 .KE .KS .PP Spruced up a bit. We add axis labels and remove some frame boundaries. Note that my version of .I grap positions left and right axis labels parallel to the axis. That feature can be disabled by specifying .CW unaligned as a justification for the label. The same data is used. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis ht 2 wid 3 left solid bot solid \&label left "Time (in seconds)" left .25 \&label bot "Olympic 400 Meter Run: Winning Times" \&draw solid \© "400mpairs.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis ht 2 wid 3 left solid bot solid label left "Time (in seconds)" left .25 label bot "Olympic 400 Meter Run: Winning Times" draw solid copy "400mpairs.d" .G2 .KE .KS .PP User specified axes, and a font change in the graph. You must restore the font after the terminating .CW .G2 . Commands to .I groff or .I pic are issued at the same place relative to other .I grap commands in the file (as of version 1.50). The frame is drawn before the first plotted element (invisible lines count) or when the frame statement is executed. .EQ delim off .EN .DS .ft CW \&.G1 \&.ft H \&frame invis ht 2 wid 3 left solid bot solid \&label left "Time (in seconds)" left .25 \&label bot "Olympic 400 Meter Run: Winning Times" \&coord x 1894, 1994 y 42, 56 \&draw solid \© "400mpairs.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 .ft H frame invis ht 2 wid 3 left solid bot solid label left "Time (in seconds)" left .25 label bot "Olympic 400 Meter Run: Winning Times" coord x 1894, 1994 y 42, 56 draw solid copy "400mpairs.d" .G2 .KE .KS .PP User specified tick placement, and a return to the Roman font. Same data. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis ht 2 wid 3 left solid bot solid \&label left "Time (in seconds)" left .25 \&label bot "Olympic 400 Meter Run: Winning Times" \&coord x 1894, 1994 y 42, 56 \&ticks left out at 44 "44", 46, 48 "48", 50, 52 "52", 54 \&ticks bot in from 1900 to 1980 by 20 \&draw solid \© "400mpairs.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis ht 2 wid 3 left solid bot solid label left "Time (in seconds)" left .25 label bot "Olympic 400 Meter Run: Winning Times" coord x 1894, 1994 y 42, 56 ticks left out at 44 "44", 46, 48 "48", 50, 52 "52", 54 ticks bot in from 1900 to 1980 by 20 draw solid copy "400mpairs.d" .G2 .KE .KS .PP This graph adds the women's times (from the same source) and includes different plotting styles and labels. My version of this graph also uses the .CW until keyword to include the data rather than external files. .CW until appears before and after the macro definition. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis ht 2 wid 3 left solid bot solid \&label left "Time (in seconds)" \&label bot "Olympic 400 Meter Run: Winning Times" \&coord x 1894, 1994 y 42, 56 \&ticks left out at 44 , 46 "", 48, 50 "", 52, 54 "" \&ticks bot in from 1900 to 1980 by 20 \&draw solid \© until "END" thru {next at $1, $2;} \&1896 54.2 \&1900 49.4 \&[...] \&1992 43.50 \&END \&new dotted \© until "END" \&1964 52. \&1968 52. \&[...] \&1992 48.83 \&END \&"Women" size -3 at 1958,52 \&"Men" size -3 at 1910,47 \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis ht 2 wid 3 left solid bot solid label left "Time (in seconds)" label bot "Olympic 400 Meter Run: Winning Times" coord x 1894, 1994 y 42, 56 ticks left out at 44 , 46 "", 48, 50 "", 52, 54 "" ticks bot in from 1900 to 1980 by 20 draw solid copy until "END" thru {next at $1, $2;} 1896 54.2 1900 49.4 1904 49.2 1908 50 1912 48.2 1920 49.6 1924 47.6 1928 47.8 1932 46.2 1936 46.5 1948 46.2 1952 45.9 1956 46.7 1960 44.9 1964 45.1 1968 43.8 1972 44.66 1976 44.26 1980 44.60 1984 44.27 1988 43.87 1992 43.50 END new dotted copy until "END" 1964 52. 1968 52. 1972 51.08 1976 49.29 1980 48.88 1984 48.83 1988 48.95 1992 48.83 END "Women" size -3 at 1958,52 "Men" size -3 at 1910,47 .G2 .KE .KS .PP Another simple copy. Bentley and Kernighan use phone installations, I use numbers of hosts on the Internet. The data is from .CW ftp://nic.merit.edu/nsfnet/statistics/history.hosts , maintained by: .DS Merit Network 4251 Plymouth Road Suite C Ann Arbor, MI 48105-2785 734-764-9430 .DE .EQ delim off .EN .DS .ft CW \&.G1 \© "internet.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 copy "internet.d" .G2 .KE .KS .PP The same data plotted on a logarithmic $y$ scale, and rescaled to megahosts, which is less humorous than megaphones. The placement of the bottom ticks shows the .CW from .. to .. by .R construct. The filename is given after the macro for variety (and to test that feature). .EQ delim off .EN .DS .ft CW \&.G1 \&coord x 80,100 y 1e-4, 30 log y \&ticks bot at 80 "1980", 100 "2000" \&ticks bot from 85 to 95 by 5 "' %g" \&ticks left \&label left "Millions of Hosts" left .25 \&label bot "Year" \&draw solid \© thru { next at $1, $2/1e6;} "internet.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 coord x 80,100 y 1e-4, 30 log y ticks bot at 80 "1980", 100 "2000" ticks bot from 85 to 95 by 5 "' %g" ticks left label left "Millions of Hosts" left .25 label bot "Year" draw solid copy thru { next at $1, $2/1e6;} "internet.d" .G2 .KE .KS .PP A demo of .I grap 's annotation abilities, mostly. The data is all in the graph specification. .EQ delim off .EN .DS .ft CW \&.G1 \&frame ht 2 wid 2 \&coord x 0,100 y 0,100 \&grid bot dotted from 20 to 80 by 20 \&grid left dotted from 20 to 80 by 20 \& \&"Text above" above at 50,50 \&"Text rjust " rjust at 50,50 \&bullet at 80,90 \&vtick at 80,80 \&box at 80,70 \× at 80,60 \& \&circle at 50,50 \&circle at 50,80 radius .25 \&line dashed from 10,90 to 30,90 \&arrow from 10,70 to 30,90 \& \&draw A solid \&draw B dashed delta \&next A at 10,10 \&next B at 10,20 \&next A at 50,20 \&next A at 90,10 \&next B at 50,30 \&next B at 90,30 \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame ht 2 wid 2 coord x 0,100 y 0,100 grid bot dotted from 20 to 80 by 20 grid left dotted from 20 to 80 by 20 "Text above" above at 50,50 "Text rjust " rjust at 50,50 bullet at 80,90 vtick at 80,80 box at 80,70 times at 80,60 circle at 50,50 circle at 50,80 radius .25 line dashed from 10,90 to 30,90 arrow from 10,70 to 30,90 draw A solid draw B dashed delta next A at 10,10 next B at 10,20 next A at 50,20 next A at 90,10 next B at 50,30 next B at 90,30 .G2 .KE .KS .PP A simple macro demo. Again, no data. .EQ delim off .EN .DS .ft CW \&.G1 \&frame ht 1.5 wid 1.5 \&define square {($1) * ($1)} \&define root {($1)^.5 } \&define P { \& times at i, square(i); i = i +1; \& circle at j, root(j); j= j+5; \&} \&i = 1; j = 5 \&P; P; P; P; P \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame ht 1.5 wid 1.5 define square {($1) * ($1)} define root {($1)^.5 } define P { times at i, square(i); i = i +1; circle at j, root(j); j= j+5; } i = 1; j = 5 P; P; P; P; P .G2 .KE .KS .PP The number of Representatives to the U.S. Congress versus population of the states. My data is more recent than that of Bentley/Kernighan, so the graph is different from theirs. Data is from the U.S. Census Bureau at .CW http://www.census.gov/ , specifically .CW http://www.census.gov/population/www/censusdata/apportionment.html . .EQ delim off .EN .DS .ft CW \&.G1 \&label left "Representatives to Congress" \&label bot "Population (Millions)" \&coord x .3, 35 y .8, 60 log log \&define PlotState { circle at $3/1e6, $2; } \© "states.d" thru PlotState \&.G2 .ft .DE .EQ delim $$ .EN .G1 label left "Representatives to Congress" label bot "Population (Millions)" coord x .3, 35 y .8, 60 log log define PlotState { circle at $3/1e6, $2; } copy "states.d" thru PlotState .G2 .KE .KS .PP A 2-axis plot. We redefine square because the macro example graph changed it. I advise against changing the predefined macro definitions because macros persist across graphs. The same data is plotted. .EQ delim off .EN .DS .ft CW \&.G1 \&define square {"\\s-2\\(sq\\s0"} \&frame ht 3 wid 3.5 \&label left "Population in Millions (Plotted as \\(bu)" \&label bot "Rank in Population" \&label right "Representatives (Plotted as \\(sq)" \&coord pop x 0,51 y .2,35 log y \&coord rep x 0,51 y .3,100 log y \&ticks left out at pop .3,1,3,10,30 \&ticks bot out at pop 1,50 \&ticks right out at rep 1,3,10,30,100 \&thisrank = 50 \© "states.d" thru { \& bullet at pop thisrank,$3/1e6 \& square at rep thisrank,$2 \& thisrank = thisrank -1 \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 define square {"\s-2\(sq\s0"} frame ht 3 wid 3.5 label left "Population in Millions (Plotted as \(bu)" label bot "Rank in Population" label right "Representatives (Plotted as \(sq)" coord pop x 0,51 y .2,35 log y coord rep x 0,51 y .3,100 log y ticks left out at pop .3,1,3,10,30 ticks bot out at pop 1,50 ticks right out at rep 1,3,10,30,100 thisrank = 50 copy "states.d" thru { bullet at pop thisrank,$3/1e6 square at rep thisrank,$2 thisrank = thisrank -1 } .G2 .KE .KS .PP A sine wave plotted by a .CW for loop with \(*p calculated with the internal .CW atan2() function. No data. .EQ delim off .EN .DS .ft CW \&.G1 \&frame ht 1 wid 3 \&draw solid \&pi = atan2(0,-1) \&for i from 0 to 2* pi by .1 do { next at i, sin(i); } \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame ht 1 wid 3 draw solid pi = atan2(0,-1) for i from 0 to 2* pi by .1 do { next at i, sin(i); } .G2 .KE .KS .PP Bentley and Kernighan do this graph with Kentucky Derby winning times. I don't have them, so I used the 400m times again. My program is slightly different because the 400m run times have gaps. .EQ delim off .EN .DS .ft CW \&.G1 \&label left "Winning Time" left .3 \&label bot "Olympics Men's 400 m" \&bestsofar = 1000 \&anchor = 0 \© "400mpairs.d" thru { \& bullet at $1,$2 \& if ( anchor != 0 ) then { \& line from anchor, bestsofar to $1,bestsofar \& } \& bestsofar = min(bestsofar,$2) \& if ( bestsofar == $2 ) then { \& anchor = $1 \& } \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 label left "Winning Time" left .3 label bot "Olympics Men's 400 m" bestsofar = 1000 anchor = 0 copy "400mpairs.d" thru { bullet at $1,$2 if ( anchor != 0 ) then { line from anchor, bestsofar to $1,bestsofar } bestsofar = min(bestsofar,$2) if ( bestsofar == $2 ) then { anchor = $1 } } .G2 .KE .KS .PP Bentley and Kernighan discuss the regression and modeling that these graphs reflect. The data is the U.S. population from the U.S. Census bureau. This shows off the ability to place two plots relative to each other using the .CW graph statement. .EQ delim off .EN .DS .ft CW \&.G1 \&graph Linear \&coord x 1785, 1955 y 0, 160 \&label left "Population in Millions" left .3 \&label right "Linear Scale" unaligned "Linear Fit" right .4 \&ticks bot off \© "usapop.d" \&define fit { 35 + 1.4 * ($1-1870) } \&line from 1850, fit(1850) to 1950,fit(1950) \&graph Exponential with .Frame.n at Linear.Frame.s - (0, .05) \&coord x 1785, 1955 y 3, 160 log y \&label left "Population in Millions" left .3 \&label right "Logarithmic Scale" unaligned "Exponential Fit" right .4 \© "usapop.d" \&define fit { exp(.75 + .012 * ($1-1800)) } \&line from 1790, fit(1790) to 1920,fit(1920) \&.G2 .ft .DE .EQ delim $$ .EN .G1 graph Linear coord x 1785, 1955 y 0, 160 label left "Population in Millions" left .3 label right "Linear Scale" unaligned "Linear Fit" right .4 ticks bot off copy "usapop.d" define fit { 35 + 1.4 * ($1-1870) } line from 1850, fit(1850) to 1950,fit(1950) graph Exponential with .Frame.n at Linear.Frame.s - (0, .05) coord x 1785, 1955 y 3, 160 log y label left "Population in Millions" left .3 label right "Logarithmic Scale" unaligned "Exponential Fit" right .4 copy "usapop.d" define fit { exp(.75 + .012 * ($1-1800)) } line from 1790, fit(1790) to 1920,fit(1920) .G2 .KE .KS .PP Another re-expression of the U.S. population data. Uses plenty of .I grap arithmetic and an .I eqn axis label (which is .CW unaligned ). .EQ delim off .EN .DS .ft CW \&.G1 \&label left "Population in Millions" left .3 \&label right "$x$ re-expressed as" unaligned "" "$space 0 left \& ( { date -1600 } over 100 right ) sup 7$" right .4 \&define newx { exp(7*(log(($1-1600)/100))) } \&ticks bot out at newx(1800) "1800", newx(1850) "1850", \\ \& newx(1900) "1900" \© "usapop.d" thru { \& if $1 <= 1900 then { bullet at newx($1),$2 } \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 label left "Population in Millions" left .3 label right "$x$ re-expressed as" unaligned "" "$space 0 left ( { date -1600 } over 100 right ) sup 7$" right .4 define newx { exp(7*(log(($1-1600)/100))) } ticks bot out at newx(1800) "1800", newx(1850) "1850", \ newx(1900) "1900" copy "usapop.d" thru { if $1 <= 1900 then { bullet at newx($1),$2 } } .G2 .KE .KS .PP A simple copy of a multiple field data file. The data is the 5th, 50th, and 95th percentiles for the heights of boys in America at different ages. The data is reported from Thomas J. Glover's remarkable .I Pocket .I Ref , which reports data from the National Center for Health Statistics. .I Pocket Ref .R is published by Sequoia Publishing, Littleton, CO. .EQ delim off .EN .DS .ft CW \&.G1 \© "boyhts.d" \&.G2 .ft .DE .EQ delim $$ .EN .G1 copy "boyhts.d" .G2 .KE .KS .PP The same data with a linear regression, and the 90% confidence intervals drawn as lines. Note the cascading assignment statements (patch courtesy of Bruce Lilly). (Bentley and Kernighan's data is in centimeters, mine is in inches, so a different conversion to feet is used.) .EQ delim off .EN .DS .ft CW \&.G1 \&label left "Heights in Feet" \&label bot "Heights of Boys in the US Ages 2-18" \&cmpft = 12 \&minx = 1e12; maxx = -1e12 \&n = sigx = sigx2 = sigy = sigxy = 0; \© "boyhts.d" thru { \& line from $1, $2/cmpft to $1, $4/cmpft \& ty = $3 / cmpft \& bullet at $1, ty \& n = n+1 \& sigx = sigx + $1; sigx2 = sigx2 + $1 * $1 \& sigy = sigy + ty; sigxy = sigxy + $1*ty \& minx = min(minx,$1); maxx = max(maxx,$1); \&} \&slope = ( n*sigxy - sigx* sigy) / (n*sigx2 - sigx * sigx) \&inter = ( sigy - slope * sigx) / n \&line from minx, slope * minx+inter to maxx, slope * maxx + inter \&.G2 .ft .DE .EQ delim $$ .EN .G1 label left "Heights in Feet" label bot "Heights of Boys in the US Ages 2-18" cmpft = 12 minx = 1e12; maxx = -1e12 n = sigx = sigx2 = sigy = sigxy = 0; copy "boyhts.d" thru { line from $1, $2/cmpft to $1, $4/cmpft ty = $3 / cmpft bullet at $1, ty n = n+1 sigx = sigx + $1; sigx2 = sigx2 + $1 * $1 sigy = sigy + ty; sigxy = sigxy + $1*ty minx = min(minx,$1); maxx = max(maxx,$1); } slope = ( n*sigxy - sigx* sigy) / (n*sigx2 - sigx * sigx) inter = ( sigy - slope * sigx) / n line from minx, slope * minx+inter to maxx, slope * maxx + inter .G2 .KE .KS .PP This is a 4 linestyle plot with a copy statement that adds labels. The scales are user-defined, and the $y$ axis is logarithmic. The data is the number of male and female officers and enlisted personnel in the U.S. Armed forces from 1940-1993 from the Pittsburgh Press .I World Almanac and Book of Facts. .R This graph has more data than the equivalent from Bentley and Kernighan. .EQ delim off .EN .DS .ft CW \&.G1 \&coord x 38, 95 y .8, 10000 log y \&label bot "U.S. Military Personnel" \&label left "Thousands" left .25 \&draw of solid \&draw ef dashed \&draw om dotted \&draw em solid \© "army.d" thru { \& next of at $1, $3 \& next ef at $1, $5 \& next om at $1, $2 \& next em at $1, $4 \&} \© until "XXX" thru { "$1 $2" size -3 at 60, $3; } \&Enlisted Men 1200 \&Male Officers 140 \&Enlisted Women 12 \&Female Officers 2.5 \&XXX \&.G2 .ft .DE .EQ delim $$ .EN .G1 coord x 38, 95 y .8, 10000 log y label bot "U.S. Military Personnel" label left "Thousands" left .25 draw of solid draw ef dashed draw om dotted draw em solid copy "army.d" thru { next of at $1, $3 next ef at $1, $5 next om at $1, $2 next em at $1, $4 } copy until "XXX" thru { "$1 $2" size -3 at 60, $3; } Enlisted Men 1200 Male Officers 140 Enlisted Women 12 Female Officers 2.5 XXX .G2 .KE .KS .PP Obfuscation of data via scatter plots. Three aligned graphs are produced that plot the numbers of enlisted men as functions of male officers, female officers, and enlisted women. The plotting symbol is the year in question. Same data as above. .EQ delim off .EN .DS .ft CW \&.G1 \&graph A \&frame ht 1.6667 wid 1.6667 \&label bot "Male_Officers" \&label left "Enlisted_Men" \&coord log log \&ticks off \© "army.d" thru { "\s-3$1\s+3" at $2,$4; } \&graph A with .Frame.w at A.Frame.e +(.1,0) \&frame ht 1.6667 wid 1.6667 \&label bot "Female_Officers" \&coord log log \&ticks off \© "army.d" thru { "\s-3$1\s+3" at $3,$4; } \&graph A with .Frame.w at A.Frame.e +(.1,0) \&frame ht 1.6667 wid 1.6667 \&label bot "Enlisted_Women" \&coord log log \&ticks off \© "army.d" thru { "\s-3$1\s+3" at $5,$4; } \&.G2 .ft .DE .EQ delim $$ .EN .G1 graph A frame ht 1.6667 wid 1.6667 label bot "Male_Officers" label left "Enlisted_Men" coord log log ticks off copy "army.d" thru { "\s-3$1\s+3" at $2,$4; } graph A with .Frame.w at A.Frame.e +(.1,0) frame ht 1.6667 wid 1.6667 label bot "Female_Officers" coord log log ticks off copy "army.d" thru { "\s-3$1\s+3" at $3,$4; } graph A with .Frame.w at A.Frame.e +(.1,0) frame ht 1.6667 wid 1.6667 label bot "Enlisted_Women" coord log log ticks off copy "army.d" thru { "\s-3$1\s+3" at $5,$4; } .G2 .KE .KS .PP One of my favorites. The solution of a differential equation and the slope field it passes through. It shows off nested .CW for loops (one using = as a synonym for from) and .I eqn labels. The data is in the graph description. .EQ delim off .EN .DS .ft CW \&.G1 \&frame ht 2.5 wid 2.5 \&coord x 0,1 y 0,1 \&label bot "Direction Field is $y prime = x sup 2 / y$" \&label left "$y = sqrt { ( 2 x sup 3 + 1 ) / 3 }$" \&ticks left in 0 left .1 at 0,1 \&ticks bot in 0 down .1 at 0,1 \&len = .04 \&for tx from .01 to .91 by .1 do { \& for ty from .01 to .91 by .1 do { \& deriv = tx*tx/ty \& scale = len / sqrt(1 + deriv*deriv) \& line from tx,ty to tx+scale, ty+scale*deriv \& } \&} \&draw solid \&for tx = 0 to 1 by .05 do { \& next at tx, sqrt((2*tx*tx*tx+1)/3) \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame ht 2.5 wid 2.5 coord x 0,1 y 0,1 label bot "Direction Field is $y prime = x sup 2 / y$" label left "$y = sqrt { ( 2 x sup 3 + 1 ) / 3 }$" ticks left in 0 left .1 at 0,1 ticks bot in 0 down .1 at 0,1 len = .04 for tx from .01 to .91 by .1 do { for ty from .01 to .91 by .1 do { deriv = tx*tx/ty scale = len / sqrt(1 + deriv*deriv) line from tx,ty to tx+scale, ty+scale*deriv } } draw solid for tx = 0 to 1 by .05 do { next at tx, sqrt((2*tx*tx*tx+1)/3) } .G2 .KE .KS .PP More population studies. State population rank vs. population, with the population on a log scale. A regression line is also plotted. I used the same line as Bentley and Kernighan, although my data is more recent. The top labels are generated by a series of macros, the frame size is enlarged, and the plotting symbol is the state abbreviation. This graph uses the same census data as above. .EQ delim off .EN .DS .ft CW \&.G1 \&frame wid 5 ht 4 \&label left "Rank in Population" \&label bot "Population (in Millions)" \&label top "$log sub 2$ Population" \&coord x .3, 35 y 0, 51 log x \&define L { (2.0^$1)/1e6 "$1" } \&ticks bot out at .5, 1, 2, 5, 10, 20 \&ticks left out from 10 to 50 by 10 \&ticks top out at L(19), L(20), L(21), L(22), L(23), L(24), L(25) \&thisy = 50 \© "states.d" thru { \& "$1" size -4 at $3/1e6, thisy \& thisy = thisy-1 \&} \&line dotted from 15.3,1 to .515, 50 \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame wid 5 ht 4 label left "Rank in Population" label bot "Population (in Millions)" label top "$log sub 2$ Population" coord x .3, 35 y 0, 51 log x define L { (2.0^$1)/1e6 "$1" } ticks bot out at .5, 1, 2, 5, 10, 20 ticks left out from 10 to 50 by 10 ticks top out at L(19), L(20), L(21), L(22), L(23), L(24), L(25) thisy = 50 copy "states.d" thru { "$1" size -4 at $3/1e6, thisy thisy = thisy-1 } line dotted from 15.3,1 to .515, 50 .G2 .KE .KS .PP A nearly useless plot of the populations of different states. Same data. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis ht .3 wid 5 bottom solid \&label bot "Populations (in Millions) of the 50 States" \&coord x .3, 35 y 0, 1 log x \&ticks bot out at .5, 1, 2, 5, 10, 20 \&ticks left off \© "states.d" thru { vtick at $3/1e6, .5; } \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis ht .3 wid 5 bottom solid label bot "Populations (in Millions) of the 50 States" coord x .3, 35 y 0, 1 log x ticks bot out at .5, 1, 2, 5, 10, 20 ticks left off copy "states.d" thru { vtick at $3/1e6, .5; } .G2 .KE .KS .PP A slight improvement, as the states are spread out and plotted with their symbols. The .CW rand() function is used to position them vertically, which shows off the function, but doesn't guarantee a legible graph. Same data. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis ht 1 wid 5 bottom solid \&label bot "Populations (in Millions) of the 50 States" \&coord x .3, 35 y 0, 1000 log x \&ticks bot out at .5, 1, 2, 5, 10, 20 \&ticks left off \© "states.d" thru { "$1" size -4 at $3/1e6, 100+900*rand(); } \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis ht 1 wid 5 bottom solid label bot "Populations (in Millions) of the 50 States" coord x .3, 35 y 0, 1000 log x ticks bot out at .5, 1, 2, 5, 10, 20 ticks left off copy "states.d" thru { "$1" size -4 at $3/1e6, 100+900*rand(); } .G2 .KE .KS .PP A histogram of the same data. The input file is a result of running the census data through the .I awk script that Bentley and Kernighan describe. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis bot solid \&label bot "Populations (in Millions) of the 50 States" \&label left "Number of States" left .1 \&ticks bot out from 0 to 35 by 5 \&coord x 0, 35 y 0, 13 \© "states2.d" thru { \& line from $1,0 to $1,$2 \& line from $1, $2 to $1+1, $2 \& line from $1+1,$2 to $1+1,0 \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis bot solid label bot "Populations (in Millions) of the 50 States" label left "Number of States" left .1 ticks bot out from 0 to 35 by 5 coord x 0, 35 y 0, 13 copy "states2.d" thru { line from $1,0 to $1,$2 line from $1, $2 to $1+1, $2 line from $1+1,$2 to $1+1,0 } .G2 .KE .KS .PP A \*Qlolliplot \*U histogram of the same data. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis bot solid \&label bot "Populations (in Millions) of the 50 States" \&label left "Number of States" left .1 \&ticks bot out from 0 to 35 by 5 \&coord x 0, 35 y 0, 13 \© "states2.d" thru { \& line dotted from $1+.5,0 to $1+.5,$2 \& "\(bu" size +3 at $1+.5, $2 \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis bot solid label bot "Populations (in Millions) of the 50 States" label left "Number of States" left .1 ticks bot out from 0 to 35 by 5 coord x 0, 35 y 0, 13 copy "states2.d" thru { line dotted from $1+.5,0 to $1+.5,$2 "\(bu" size +3 at $1+.5, $2 } .G2 .KE .KS .PP A histogram of state abbreviations. The data has been massaged by the .I awk program described by Bentley and Kernighan. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis wid 4 ht 2.5 bot solid \&label bot "Populations (in Millions) of the 50 States" \&ticks bot out from 0 to 35 by 5 \&ticks left off \&coord x 0, 35 y 0, 13 \© "states3.d" thru {"$1" size -4 at $2+.5, $3+.5; } \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis wid 4 ht 2.5 bot solid label bot "Populations (in Millions) of the 50 States" ticks bot out from 0 to 35 by 5 ticks left off coord x 0, 35 y 0, 13 copy "states3.d" thru {"$1" size -4 at $2+.5, $3+.5; } .G2 .KE .KS .PP A bar graph of profiler output. The output is from running .I grap on this file. .EQ delim off .EN .DS .ft CW \&.G1 \&ticks left off \&cury = 0 \&barht = .7 \© "prof2.d" thru { \& line from 0,cury to $1, cury \& line from $1, cury to $1, cury-barht \& line from 0, cury-barht to $1, cury-barht \& " $2" ljust at 0, cury-barht/2 \& cury = cury-1 \&} \&line from 0,0 to 0,cury+1-barht \&bars = -cury \&frame invis ht bars/3 wid 3 \&.G2 .ft .DE .EQ delim $$ .EN .G1 ticks left off cury = 0 barht = .7 copy "prof2.d" thru { line from 0,cury to $1, cury line from $1, cury to $1, cury-barht line from 0, cury-barht to $1, cury-barht " $2" ljust at 0, cury-barht/2 cury = cury-1 } line from 0,0 to 0,cury+1-barht bars = -cury frame invis ht bars/3 wid 3 .G2 .KE .KS .PP The creative graph of state heights and volcano heights from their grap paper. The data was included in the graph description, which (according to Bruce Lilly) is from John W. Tukey's classic 1977 text .I Exploratory Data Analysis, .R Chapter 10. Tukey cites \*QThe World Almanac, 1966, page 269. Their source: National Geographic Society.\*U The format of the graph is also similar to a graph on pg. 40 (exhibit 5, chapter 2). All those attributions are from Bruce Lilly. I don't have the relevant material to verify it, but have no reason to doubt the accuracy of the information. .EQ delim off .EN .DS .ft CW .ps 8 .vs 10 \&.G1 \&frame invis ht 4 wid 3 bot solid \&ticks off \&coord x .5, 3.5 y 0,25 \&define Ht { "- $1,000 -" size -3 at 2, $1 } \&Ht(5); Ht(10); Ht(15); Ht(20); \&"Highest Point" "in 50 States" at 1,23 \&"Heights of" "219 Volcanos" at 3,23 \&"Feet" at 2,21.5; arrow from 2,22.5 to 2,24 \&define box { \& xc = $1; xl = xc - boxwidth/2; xh = xc+boxwidth/2 \& y1 = $2; y2 = $3; y3 = $4; y4= $5; y5 = $6 \& bullet at xc,y1 \& " $7" size -3 ljust at xc, y1 \& line from (xc,y1) to (xc,y2) \& line from (xl,y2) to (xh,y2) \& line from (xl,y3) to (xh,y3) \& line from (xl,y4) to (xh,y4) \& line from (xl,y2) to (xl,y4) \& line from (xh,y2) to (xh,y4) \& line from (xc,y4) to (xc,y5) \& bullet at xc,y5 \& " $8" ljust size -3 at (xc,y5) \&} \&boxwidth = .3 \&box(1, .3, 2.0, 4.6, 11.2,20.3, Florida, Alaska) \&box(3,.2, 3.7, 6.5, 9.5, 19.9, Ilhanova, Guallatiri) \&.G2 .ft .DE .KE .KS .EQ delim $$ .EN .G1 frame invis ht 4 wid 3 bot solid ticks off coord x .5, 3.5 y 0,25 define Ht { "- $1,000 -" size -3 at 2, $1 } Ht(5); Ht(10); Ht(15); Ht(20); "Highest Point" "in 50 States" at 1,23 "Heights of" "219 Volcanos" at 3,23 "Feet" at 2,21.5; arrow from 2,22.5 to 2,24 define box { xc = $1; xl = xc - boxwidth/2; xh = xc+boxwidth/2 y1 = $2; y2 = $3; y3 = $4; y4= $5; y5 = $6 bullet at xc,y1 " $7" size -3 ljust at xc, y1 line from (xc,y1) to (xc,y2) line from (xl,y2) to (xh,y2) line from (xl,y3) to (xh,y3) line from (xl,y4) to (xh,y4) line from (xl,y2) to (xl,y4) line from (xh,y2) to (xh,y4) line from (xc,y4) to (xc,y5) bullet at xc,y5 " $8" ljust size -3 at (xc,y5) } boxwidth = .3 box(1, .3, 2.0, 4.6, 11.2,20.3, Florida, Alaska) box(3,.2, 3.7, 6.5, 9.5, 19.9, Ilhanova, Guallatiri) .G2 .KE .KS .PP A large but boring graph. No data, but it does show off passing size parameters to .I pic , and using non-brace macro delimiters. .EQ delim off .EN .DS .ft CW \&.ps 14 \&.vs 18 \&.G1 4 \&frame ht 2 wid 2 \&label left "Response Variable" left .2 \&label bot "Factor Variable" down .1 \&line from 0,0 to 1,1 \&line dotted from .5,0 to .5,1 \&define blob X "\\v'.1m'\\(bu\\v'-.1m'" X \&blob at 0,.5; blob at .5, .5; blob at 1,.5 \&.G2 \&.ps 10 \&.vs 12 .ft .DE .EQ delim $$ .EN .ps 14 .vs 18 .G1 4 frame ht 2 wid 2 label left "Response Variable" left .2 label bot "Factor Variable" down .1 line from 0,0 to 1,1 line dotted from .5,0 to .5,1 define blob X "\v'.1m'\(bu\v'-.1m'" X blob at 0,.5; blob at .5, .5; blob at 1,.5 .G2 .ps 10 .vs 12 .KE .KS .PP This displays all the macros defined in .CW grap.defines . No data. .EQ delim off .EN .DS .ft CW \&.G1 \&define box {"\\s-2\\f(ZD\\N'110'\\fP\\s0"} \&frame ht 2 wid 2 \&coord x 0,3 y 0,6 \&ticks off \&ticks left in left .1 from 1 to 5 \&ticks right in from 1 to 5 "" \&ticks bot in down .1 from 1 to 2 \&ticks top in from 1 to 2 "" \&bullet at 1,1 \&plus at 1,2 \&box at 1,3 \&star at 1,4 \&dot at 1,5 \× at 2,1 \&htick at 2,2 \&vtick at 2,3 \&square at 2,4 \&delta at 2,5 \&.G2 .ft .DE .EQ delim $$ .EN .G1 define box {"\s-2\f(ZD\N'110'\fP\s0"} frame ht 2 wid 2 coord x 0,3 y 0,6 ticks off ticks left in left .1 from 1 to 5 ticks right in from 1 to 5 "" ticks bot in down .1 from 1 to 2 ticks top in from 1 to 2 "" bullet at 1,1 plus at 1,2 box at 1,3 star at 1,4 dot at 1,5 times at 2,1 htick at 2,2 vtick at 2,3 square at 2,4 delta at 2,5 .G2 .KE .KS .PP We saw this graph earlier using line drawing commands. This version uses the .CW bar extension. Bars are centered, so the 0.5 unit fudge factor is used. If I were graphing this from scratch, I would rewrite the .I awk script to place the bars correctly. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis bot solid \&label bot "Populations (in Millions) of the 50 States" \&label left "Number of States" left .1 \&ticks bot out from 0 to 35 by 5 \&coord x 0, 35 y 0, 13 \© "states2.d" thru { \& bar up $1+0.5 ht $2 fill 0.125 \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis bot solid label bot "Populations (in Millions) of the 50 States" label left "Number of States" left .1 ticks bot out from 0 to 35 by 5 coord x 0, 35 y 0, 13 copy "states2.d" thru { bar up $1+0.5 ht $2 fill 0.125 } .G2 .KE .KS .PP The same graph with bars extending in the x direction. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis bot solid \&label left "Populations (in Millions) of the 50 States" \&label bot "Number of States" \&ticks left out from 0 to 35 by 5 \&coord x 0, 13 y -0, 35 \© "states2.d" thru { \& bar right $1+0.5 ht $2 fill 0.125 \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis bot solid label left "Populations (in Millions) of the 50 States" label bot "Number of States" ticks left out from 0 to 35 by 5 coord x 0, 13 y 0, 35 copy "states2.d" thru { bar right $1+0.5 ht $2 fill 0.125 } .G2 .KE .KS .PP Demonstration of negative bar heights. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis bot solid \© until "DONE" thru { \& bar up $1 ht $2 \&} \&1 -2 \&2 -1 \&3 0 \&4 1 \&5 2 \&DONE \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis bot solid copy until "DONE" thru { bar up $1 ht $2 } 1 -2 2 -1 3 0 4 1 5 2 DONE .G2 .KE .KS .PP A display of two timing measurements and the components thereof. The data is fabricated, I just wanted to show the format, including both formats of .CW bar statement. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis bot solid left solid \&ticks bottom off \&grid bottom invis at 1 "OS 1", 2 "OS2" \&coord y 0, 10 \© until "DONE" thru { \& bar up $1 ht $2 wid 0.5 base $3 fill $4 \&} \&1 3 0 0.25 \&1 1 3 0.5 \&1 4 4 0.9 \&2 1 0 0.25 \&2 4 1 0.5 \&2 2 5 0.9 \&DONE \© until "DONE" thru { \& bar 1.5,$1, 1.75, $1+0.2 fill $2 \& $3 size -2 ljust at 1.8,$1+0.1 \&} \&9 0.25 "Copying" \&8.5 0.5 "Initialization" \&8 0.9 "Checksum" \&DONE \&bar 1.45,9.35, 2.25, 7.85 dashed \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis bot solid left solid ticks bottom off grid bottom invis at 1 "OS 1", 2 "OS2" coord y 0, 10 copy until "DONE" thru { bar up $1 ht $2 wid 0.5 base $3 fill $4 } 1 3 0 0.25 1 1 3 0.5 1 4 4 0.9 2 1 0 0.25 2 4 1 0.5 2 2 5 0.9 DONE copy until "DONE" thru { bar 1.5,$1, 1.75, $1+0.2 fill $2 $3 size -2 ljust at 1.8,$1+0.1 } 9 0.25 "Copying" 8.5 0.5 "Initialization" 8 0.9 "Checksum" DONE bar 1.45,9.35, 2.25, 7.85 dashed .G2 .KE .KS .PP This shows the new filling and linestyle capabilities of the .CW circle and .CW bar commands .EQ delim off .EN .DS .ft CW \&.G1 \&bar (1,1), (0,0) fill 0.25 \&circle at 0.5,0.5 rad 0.5 dashed 0.05 fill 0.5 \&.G2 .ft .DE .G1 bar (1,1), (0,0) fill 0.25 circle at 0.5,0.5 rad 0.5 dashed 0.05 fill 0.5 .G2 .KE .KS This is a more complex example of nested macros from Anindo Banerjea's thesis. This originally caught errors in the use of multiple positioning commands for labels. I don't know what the data are, but a full explanation is in his Ph.D thesis. In-line data and the groff for the caption are elided. Two lines present in the real graph are missing from this one. .DS .ft CW .ps 8 .vs 10 \&.ds ** \\v'+.2m'\\fB*\\fP\\v'-.2m' \&.vs 10 \&.G1 \&define myplot % # (symbol) \&next linename at $1,$2 \&symb at $1,$2 \&% \&graph A \&frame invis ht 1.667 wid 2.0 left solid bot solid \&coord y 0,70 \&label bot "delay (ms)" "\\fIi)\\fP" down 0.3 \&label left "load" unaligned "index" up .9 \&label right "Xmin = 2: \\(bu" unaligned ljust size -3 "Xmin = 4:\\(sq" \\ \& "Xmin = 8:\\(ci" "Xmin = 16: \\*(**" left 1.4 up 0.5 \&draw a solid \&define symb % bullet % \&define linename { a } \© until "XXX" thru myplot \&50 42.000 \&... \&XXX \&draw b solid \&define symb % square % \&define linename { b } \© until "XX1" thru myplot \&50 22.000 \&... \&XX1 \&.G2 .ft .ps 10 .vs 12 .DE .ds ** \v'+.2m'\fB*\fP\v'-.2m' .vs 10 .G1 2i define myplot % # (symbol) next linename at $1,$2 symb at $1,$2 % graph A frame invis ht 1.667 wid 2.0 left solid bot solid coord y 0,70 label bot "delay (ms)" "\fIi)\fP" down 0.3 label left "load" unaligned "index" up .9 label right "Xmin = 2: \(bu" unaligned ljust size -3 "Xmin = 4:\(sq" \ "Xmin = 8:\(ci" "Xmin = 16: \*(**" left 1.4 up 0.5 draw a solid define symb % bullet % define linename { a } copy until "XXX" thru myplot 50 42.000 60 41.800 70 41.400 80 40.000 90 39.000 100 37.800 110 36.400 120 33.000 130 31.000 140 28.800 150 26.400 160 21.000 170 18.000 180 14.800 190 11.400 200 4.000 210 4.000 220 4.000 XXX draw b solid define symb % square % define linename { b } copy until "XX1" thru myplot 50 22.000 60 21.800 70 21.600 80 20.800 90 20.200 100 19.600 110 18.800 120 17.000 130 16.000 140 14.800 150 13.600 160 10.800 170 9.200 180 7.600 190 5.800 200 2.000 210 2.000 220 2.000 XX1 .G2 .LP \fB Figure 1.\fP Queueing Delay index vs. other load indices: Graph \fIi)\fP shows that the proposed load index is monotonically decreasing as a function of delay if all other factors are constant. Graph \fIii)\fP shows that it is linear in bandwidth and graph \fIiii)\fP shows that it is linear in the path length of the route provided the delay requirement per hop remains constant. .vs 12 .KE .KS .PP This graph is pretty brutal all around. Nested macros and constructed filenames produce a bar graph (some of the components separated by dots in the included filenames were originally pathname components). This source is also from Anindo Banerjea, and caught bugs related to .CW if and .CW for statements. Anindo wrote this to display a graph for his thesis, not to demonstrate perfect .CW grap programming form. His graphs are used with his permission, I've made minor tweaks to his code to make them more pretty under this version of .CW grap . .DS .ft CW .ps 8 .vs 10 \&.G1 \&define write_name % #(code,X,Y) \& if ($1 == 1) then { \& "\\s-2G\\s+2" above at $2,$3 \& } \& if ($1 == 2) then { \& "\\s-2H\\s+2" above at $2,$3 \& } \& if ($1 == 3) then { \& "\\s-2L\\s+2" above at $2,$3 \& } \& if ($1 == 4) then { \& "\\s-2I\\s+2" above at $2,$3 \& } \& if ($1 == 5) then { \& "\\s-2R1\\s+2" above at $2,$3 \& } \& if ($1 == 6) then { \& "\\s-2R2\\s+2" above at $2,$3 \& } \& if ($1 == 7) then { \& "\\s-2R3\\s+2" above at $2,$3 \& } \& if ($1 == 8) then { \& "\\s-2S\\s+2" above at $2,$3 \& } \&% \&define dashedbar % #(X,Y) \& line from $1,0 to $1,$2 dashed \& line from $1,$2 to $1+9,$2 dashed \& line from $1+9,$2 to $1+9,0 dashed \&% \&define abar % #(X,Y) \& line from $1,0 to $1,$2 \& line from $1,$2 to $1+9,$2 \& line from $1+9,$2 to $1+9,0 \&% \&define bar_succ % #(load,y,junk) \& abar(curx,$2) \& write_name(name,curx+5,$2) \& curx = curx + jump \& if (Maxy < $2) then { Maxy = $2 } \&% \&define bar_goodness % #(load,y,junk) \& abar(curx,$3-100) \& write_name(name,curx+5,$3-100) \& curx = curx + jump \& if (Maxy < ($3-100) ) then { Maxy = $3-100 } \&% \&define bar_avmax % #(load,average,max) \& abar(curx,$2) \& dashedbar(curx,$3) \& write_name(name,curx+5,$3) \& curx = curx+jump \& if (Maxy < $3) then { Maxy = $3 } \&% \&define bar_set % #(filename,jump,startX,name,function) \& jump = $2 \& curx = $3 \& name = $4 \& copy $1 thru bar_$5 \&% \&define setload % #(load, junk, junk \& ticks bot in 0.0 at ((2*count+1)*jump-gap/2)/2 "$1" \& count = count + 1 \&% \&define mkgraphTiming % #(Timing,Name,file,function,number,ylabel,dir,toplable) \& Maxy = 0.0 \& Nbars = 3 \& start = 1 \& gap = 15 \& jump = Nbars * 10 + gap \& bar_set("$7.Global.$1.$3.result",jump,start,1,$4) \& bar_set("$7.Hybrid.$1.$3.result",jump,start + 10,2,$4) \& bar_set("$7.Local.$1.$3.result",jump,start + 2*10,3,$4) \& line from 0,0 to jump*4-gap,0 \& count = 0 \& copy "$7.Local.$1.$3.result" through setload \& label top "\\fI$5)\\fP Timing = $2, $8" up .2 \& label left $6 unaligned up 1.8 right .2 \& label bot "load" \& frame invis ht 3 wid 3 left solid bot solid \&% \&graph A \& mkgraphTiming(Random1500,Random-1500 ms,succ,succ,i,"SR (%)",\\ \& result.SQ_MESH.Fail1.S3.R0,Square mesh) \&.G2 .ft .ps 10 .vs 12 .DE .G1 2.5i define write_name % #(code,X,Y) if ($1 == 1) then { "\s-2G\s+2" above at $2,$3 } if ($1 == 2) then { "\s-2H\s+2" above at $2,$3 } if ($1 == 3) then { "\s-2L\s+2" above at $2,$3 } if ($1 == 4) then { "\s-2I\s+2" above at $2,$3 } if ($1 == 5) then { "\s-2R1\s+2" above at $2,$3 } if ($1 == 6) then { "\s-2R2\s+2" above at $2,$3 } if ($1 == 7) then { "\s-2R3\s+2" above at $2,$3 } if ($1 == 8) then { "\s-2S\s+2" above at $2,$3 } % define dashedbar % #(X,Y) line from $1,0 to $1,$2 dashed line from $1,$2 to $1+9,$2 dashed line from $1+9,$2 to $1+9,0 dashed % define abar % #(X,Y) line from $1,0 to $1,$2 line from $1,$2 to $1+9,$2 line from $1+9,$2 to $1+9,0 % define bar_succ % #(load,y,junk) abar(curx,$2) write_name(name,curx+5,$2) curx = curx + jump if (Maxy < $2) then { Maxy = $2 } % define bar_goodness % #(load,y,junk) abar(curx,$3-100) write_name(name,curx+5,$3-100) curx = curx + jump if (Maxy < ($3-100) ) then { Maxy = $3-100 } % define bar_avmax % #(load,average,max) abar(curx,$2) dashedbar(curx,$3) write_name(name,curx+5,$3) curx = curx+jump if (Maxy < $3) then { Maxy = $3 } % define bar_set % #(filename,jump,startX,name,function) jump = $2 curx = $3 name = $4 copy $1 thru bar_$5 % define setload % #(load, junk, junk ticks bot in 0.0 at ((2*count+1)*jump-gap/2)/2 "$1" count = count + 1 % define mkgraphTiming % #(Timing,Name,file,function,number,ylabel,dir,toplable) Maxy = 0.0 Nbars = 3 start = 1 gap = 15 jump = Nbars * 10 + gap bar_set("$7.Global.$1.$3.result",jump,start,1,$4) bar_set("$7.Hybrid.$1.$3.result",jump,start + 10,2,$4) bar_set("$7.Local.$1.$3.result",jump,start + 2*10,3,$4) line from 0,0 to jump*4-gap,0 count = 0 copy "$7.Local.$1.$3.result" through setload label top "\fI$5)\fP Timing = $2, $8" up .2 label left $6 unaligned up 1.8 right .2 label bot "load" frame invis ht 3 wid 3 left solid bot solid % graph A mkgraphTiming(Random1500,Random-1500 ms,succ,succ,i,"SR (%)",result.SQ_MESH.Fail1.S3.R0,Square mesh) .G2 .KE .KS .PP This is a graph donated by Bruce Lilly, after it demonstrated a couple .CW grap bugs and incompatibilities with DWB .CW grap . But mostly I include it because it's a cool timing diagram, although I have no idea for what. I shrunk it for this example, so this version is a little more cramped than his. Remove the 4 that follows the .G1 to see the diagram in its full glory. .DS .ft CW .ps 8 .vs 10 \&.G1 4 \&.ps 14 \&frame ht 5 wid 6 top invis right invis left invis bot invis \&ticks off \&coord x -21, 21 y 0, 70 \&line dashed from (0,0) to (0,68) \&line dotted from (-11,0) to (-11,70) \&line dotted from (11,0) to (11,70) \&"clock" rjust at -21, 3.5 \&"data" rjust at -21, 35 \&"timing reference" below at 0, -1 \&"recovery window" at 0, 70 \&arrow from (-6,70) to (-10,70) \&arrow from (6,70) to (10,70) \&"``perfect'' data" at 0, 13.5 \&"jitter" at 0, 23.5 \&"timing offset" at 0, 38.3 \&"timing offset + jitter" at 0, 58.3 \&.\\" clock \&draw solid \&[inline data elided] \&.\\" perfect data \&new solid \&[inline data elided] \&new solid \&[inline data elided] \&.\\" data with jitter +-3 ns \&new solid \&[inline data elided] \&new solid \&[inline data elided] \&.\\" +3 ns \&new dashed \&[inline data elided] \&new dashed \&[inline data elided] \&.\\" -3 ns \&new dashed \&[inline data elided] \&new dashed \&[inline data elided] \&.\\" timing offset +3 ns \&new solid \&[inline data elided] \&new solid \&[inline data elided] \&.\\" timing offset -3 ns \&new solid \&[inline data elided] \&new solid \&[inline data elided] \&.\\" +3 ns timing offset +-3 ns jitter \&.\\" +3 ns timing offset \&new solid \&[inline data elided] \&new solid \&[inline data elided] \&.\\" -3 ns jitter around +3 ns timing offset \&new dashed \&[inline data elided] \&new dashed \&[inline data elided] \&.\\" +3 ns jitter around +3 ns timing offset \&new dashed \&[inline data elided] \&new dashed \&[inline data elided] \&.\\" -3 ns timing offset +-3 ns jitter \&.\\" -3 ns timing offset \&new solid \&[inline data elided] \&new solid \&[inline data elided] \&.\\" -3 ns jitter around -3 ns timing offset \&new dashed \&[inline data elided] \&new dashed \&[inline data elided] \&.\\" +3 ns jitter around -3 ns timing offset \&new dashed \&[inline data elided] \&new dashed \&[inline data elided] \&.ps \&.G2 .ft .DE .G1 4 .ps 14 frame ht 5 wid 6 top invis right invis left invis bot invis ticks off coord x -21, 21 y 0, 70 line dashed from (0,0) to (0,68) line dotted from (-11,0) to (-11,70) line dotted from (11,0) to (11,70) "clock" rjust at -21, 3.5 "data" rjust at -21, 35 "timing reference" below at 0, -1 "recovery window" at 0, 70 arrow from (-6,70) to (-10,70) arrow from (6,70) to (10,70) "``perfect'' data" at 0, 13.5 "jitter" at 0, 23.5 "timing offset" at 0, 38.3 "timing offset + jitter" at 0, 58.3 .\" clock draw solid -21, 7 -16, 0 -2.5, 0 2.5, 7 16, 7 21, 0 .\" perfect data new solid -21, 17 -16, 10 16, 10 21, 17 new solid -21, 10 -16, 17 16, 17 21, 10 .\" data with jitter +-3 ns new solid -21, 27 -16, 20 16, 20 21, 27 new solid -21, 20 -16, 27 16, 27 21, 20 .\" +3 ns new dashed -21, 27 -18, 27 -13, 20 19, 20 21, 22.8 new dashed -21, 20 -18, 20 -13, 27 19, 27 21, 24.2 .\" -3 ns new dashed -21, 22.8 -19, 20 13, 20 18, 27 21, 27 new dashed -21, 24.2 -19, 27 13, 27 18, 20 21, 20 .\" timing offset +3 ns new solid -21, 37 -18, 37 -13, 30 19, 30 21, 32.8 new solid -21, 30 -18, 30 -13, 37 19, 37 21, 34.2 .\" timing offset -3 ns new solid -21, 44.2 -19, 47 13, 47 18, 40 21, 40 new solid -21, 42.8 -19, 40 13, 40 18, 47 21, 47 .\" +3 ns timing offset +-3 ns jitter .\" +3 ns timing offset new solid -21, 57 -18, 57 -13, 50 19, 50 21, 52.8 new solid -21, 50 -18, 50 -13, 57 19, 57 21, 54.2 .\" -3 ns jitter around +3 ns timing offset new dashed -21, 57 -15, 57 -10, 50 21, 50 new dashed -21, 50 -15, 50 -10, 57 21, 57 .\" +3 ns jitter around +3 ns timing offset new dashed -21, 57 -16, 50 16, 50 21, 57 new dashed -21, 50 -16, 57 16, 57 21, 50 .\" -3 ns timing offset +-3 ns jitter .\" -3 ns timing offset new solid -21, 64.2 -19, 67 13, 67 18, 60 21, 60 new solid -21, 62.8 -19, 60 13, 60 18, 67 21, 67 .\" -3 ns jitter around -3 ns timing offset new dashed -21, 67 10, 67 15, 60 21, 60 new dashed -21, 60 10, 60 15, 67 21, 67 .\" +3 ns jitter around -3 ns timing offset new dashed -21, 60 -16, 67 16, 67 21, 60 new dashed -21, 67 -16, 60 16, 60 21, 67 .ps .G2 .\" " .KE .KS Bruce Lilly also suggests this example. He says: .QP I've attached a small data file and simple grap specification which shows one way to handle missing data (and perhaps also how to ignore a column header row in a data file). The data is annual US bicyclist fatalities as published by the National Highway Transportation Safety Administration .I http://www.nhtsa.dot.gov/people/ncsa/factshet.html ; ( the \*Qfact sheets\*U for \*Qpedalcyclists\*U for 1998 and for 1993) and by the National Center for Injury Prevention and Control .I http://www.cdc.gov/ncipc/osp/us9693/mvpctr.htm ; ( change the numbers for different years). CDC data hasn't yet been published for 1997 or 1998. Don't ask me why two groups of bureaucrats in the US Federal Government can't agree on the numbers. The data is, of course, public information, and there's no reason why you can't use the trivial grap specification (though you might wish to embellish it). .LP I did embellish it by adding labels and a key. .DS .CW \&.G1 \&label top "Bicycling Deaths by Year" \&label left "Deaths" left 0.2 \&label bottom "Year" \© "cy_fatal.d" through { \& # ignore missing data (zero or negative values \& # used as placeholders). It also happens to ignore column \& # header rows in data. \& if $2 > 0 then {square at $1,$2 } \& if $3 > 0 then {bullet at $1,$3 } \&} \&square at 1993, 925 \&"NHTSA data" ljust at 1993.5, 925 \&bullet at 1993, 900 \&"CDC data" ljust at 1993.5, 900 \&line from 1992.5,940 to 1998,940 \&line from 1998,940 to 1998,890 \&line from 1998,890 to 1992.5, 890 \&line from 1992.5, 890 to 1992.5,940 \&.G2 .DE .G1 label top "Bicycling Deaths by Year" label left "Deaths" left 0.2 label bottom "Year" copy "cy_fatal.d" through { # ignore missing data (zero or negative values # used as placeholders). It also happens to ignore column # header rows in data. if $2 > 0 then {square at $1,$2 } if $3 > 0 then {bullet at $1,$3 } } square at 1993, 925 "NHTSA data" ljust at 1993.5, 925 bullet at 1993, 900 "CDC data" ljust at 1993.5, 900 line from 1992.5,940 to 1998,940 line from 1998,940 to 1998,890 line from 1998,890 to 1992.5, 890 line from 1992.5, 890 to 1992.5,940 .G2 .KE .KS This example shows off the new automatic tick generation for named coordinate systems. It is a re-plot of earlier data. The automatic ticks do not look great here because they are generated on a logarithmic axis. Still, it means that the graph can be generated without constants in the grap code. .DS .CW \&.G1 \&define square {"\\s-2\\(sq\\s0"} \&frame ht 3 wid 3.5 \&label left "Population in Millions (Plotted as \(bu)" \&label bot "Rank in Population" \&label right "Representatives (Plotted as \(sq)" \&coord pop log y \&coord rep log y \&ticks left out auto pop \&ticks bot out auto pop \&ticks right out auto rep \&thisrank = 50 \© "states.d" thru { \& bullet at pop thisrank,$3/1e6 \& square at rep thisrank,$2 \& thisrank = thisrank -1 \&} \&.G2 .DE .G1 define square {"\s-2\(sq\s0"} frame ht 3 wid 3.5 label left "Population in Millions (Plotted as \(bu)" label bot "Rank in Population" label right "Representatives (Plotted as \(sq)" coord pop log y coord rep log y ticks left out auto pop ticks bot out auto pop ticks right out auto rep thisrank = 50 copy "states.d" thru { bullet at pop thisrank,$3/1e6 square at rep thisrank,$2 thisrank = thisrank -1 } .G2 .KE .KS .PP This is a demonstration of the new line clipping. The right graph is a detail of the left, created by simply respecifying the coordinate limits. (The region plotted in the right graph is the dotted rectangle in the left.) Note that the data is clipped leaving the area plotted and returning. The data is the 400 Meter Run Olympic data from before. .EQ delim off .EN .DS .ft CW \&graph Main \&frame invis ht 2 wid 2.5 left solid bot solid \&label left "Time (in seconds)" \&label bot "Olympic 400 Meter Run: Winning Times" right 1.75 \&coord x 1894, 1994 y 42, 56 \&ticks left out at 44 "44", 46, 48 "48", 50, 52 "52", 54 \&ticks bot in from 1900 to 1980 by 20 \&draw solid \© "400mpairs.d" \&bar (1908,46), (1940,49) dashed \&# detail graph \&graph Detail with .w at Main.Frame.e +(0.1,0) \&frame dashed ht 2 wid 2.5 right solid bot solid \&label right "Time (in seconds)" \&ticks left off \&ticks right on \&ticks bot in \&draw solid \© "400mpairs.d" \&coord x 1908,1942 y 45,49 .ft .DE .EQ delim $$ .EN .G1 graph Main frame invis ht 2 wid 2.5 left solid bot solid label left "Time (in seconds)" label bot "Olympic 400 Meter Run: Winning Times" right 1.75 coord x 1894, 1994 y 42, 56 ticks left out at 44 "44", 46, 48 "48", 50, 52 "52", 54 ticks bot in from 1900 to 1980 by 20 draw solid copy "400mpairs.d" bar (1908,46), (1940,49) dashed # detail graph graph Detail with .w at Main.Frame.e +(0.1,0) frame dashed ht 2 wid 2.5 right solid bot solid label right "Time (in seconds)" ticks left off ticks right on ticks bot in draw solid copy "400mpairs.d" coord x 1908,1942 y 45,49 .G2 .KE .KS .PP Revisiting the boy heights example to demonstrate some other .CW grap features. New to this version is the ability to use x and y directly as variable names anywhere but a .CW coord statement. Fixed as of release 1.10 is the ability to start a new line of the named style (or the default if no name is given) using the .CW new statement. The variable .CW y is directly used in the computation of the regression, and each dashed error bar is drawn using the conf line style. Otherwise this is the earlier graph. .EQ delim off .EN .DS .ft CW \&.G1 \&label left "Heights in Feet" \&label bot "Heights of Boys in the US Ages 2-18" \&cmpft = 12 \&minx = 1e12; maxx = -1e12 \&n = sigx = sigx2 = sigy = sigxy = 0; \&draw conf dashed \© "boyhts.d" thru { \& new conf \& next conf at $1, $2/cmpft \& next conf at $1, $4/cmpft \& y = $3 / cmpft \& bullet at $1, y \& n = n+1 \& sigx = sigx + $1; sigx2 = sigx2 + $1 * $1 \& sigy = sigy + y; sigxy = sigxy + $1*y \& minx = min(minx,$1); maxx = max(maxx,$1); \&} \&slope = ( n*sigxy - sigx* sigy) / (n*sigx2 - sigx * sigx) \&inter = ( sigy - slope * sigx) / n \&line from minx, slope * minx+inter to maxx, slope * maxx + inter \&.G2 .ft .DE .EQ delim $$ .EN .G1 label left "Heights in Feet" label bot "Heights of Boys in the US Ages 2-18" cmpft = 12 minx = 1e12; maxx = -1e12 n = sigx = sigx2 = sigy = sigxy = 0; draw conf dashed copy "boyhts.d" thru { new conf next conf at $1, $2/cmpft next conf at $1, $4/cmpft y = $3 / cmpft bullet at $1, y n = n+1 sigx = sigx + $1; sigx2 = sigx2 + $1 * $1 sigy = sigy + y; sigxy = sigxy + $1*y minx = min(minx,$1); maxx = max(maxx,$1); } slope = ( n*sigxy - sigx* sigy) / (n*sigx2 - sigx * sigx) inter = ( sigy - slope * sigx) / n line from minx, slope * minx+inter to maxx, slope * maxx + inter .G2 .KE .KS .PP Some fun with embedded pic and troff to show that they work. The plotting points are made by a troff font change to Helvetica, drawing an \*Qx\*U in grap, then a pic box around it, a second troff font change and another grap label. This example will almost certainly fail under TeX. .EQ delim off .EN .DS .ft CW \&.G1 \&coord x 5,35 y 5, 35 \&ticks off \© until "END" thru { \&. ft H \& "x" at $1, $2 \& pic box ht 0.1 wid 0.1 at Here \&. ft R \& "" "$3" below at $1, $2 \&} \&10 10 here's \&20 20 some \&30 30 pic/troff \&END \&.G2 .DE .EQ delim $$ .EN .ft .G1 coord x 5,35 y 5, 35 ticks off copy until "END" thru { . ft H "x" at $1, $2 pic box ht 0.1 wid 0.1 at Here . ft R "" "$3" below at $1, $2 } 10 10 here's 20 20 some 30 30 pic/troff END .G2 .KE .KS .PP .CW grap is now .I much more context sensitive in how it picks out keywords. There are still some places where it will resolutely not allow variables with keyword names, but it's enormously better about it. Here's a short somewhat pathological example. I couldn't decide which for loop was less readable, so I used both. .EQ delim off .EN .DS .ft CW \&.G1 \&from=0 \&to = 10 \&ht =3 \&wid = 5 \&frame ht ht wid wid \&for i from from to to do { \& delta at i, i \&} \&for j = from to to do { \& bullet at to - j, j \&} \&.G2 .ft .DE .EQ delim $$ .EN .G1 from=0 to = 10 ht =3 wid = 5 frame ht ht wid wid for i from from to to do { delta at i, i } for j = from to to do { bullet at to - j, j } .G2 .KE .bp .KS .PP At the request of Bruce Lilly, coordinate spaces and variables now have distinct name spaces, and those names spaces can (usually) overlap both each other and keywords. The result is that things like this are legal. .DS .ft CW \&.G1 \&from = 0 \&to = 10 \&new next dotted delta \&for next from from to to do { \& next next at next next, next \&} \&ticks left on next \&ticks bot on next \&.G2 .ft .DE .G1 from = 0 to = 10 new next dotted delta for next from from to to do { next next at next next, next } ticks left on next ticks bot on next .G2 .PP I think we're now ready for the first obfuscated .CW grap contest. The following is a more readable version: .DS .ft CW \&.G1 \&start = 0 \&finish = 10 \&new line_style dotted delta \&coord coord_space \&for i from start to finish do { \& next line_style at coord_space i, i \&} \&ticks left on coord_space \&ticks bot on coord_space \&.G2 .ft .DE .KE .KS One of the few things that one couldn't do under recent versions of .CW grap was redefining keywords. Now you can. Here's an example that redefines the bar keyword. This also demonstrates the new undefine keyword that restores the original bar semantics. .DS .ft CW \&.G1 \&define bar { "_" } \&for i = 1 to 10 do { \& bar at i,i \&} \&undefine bar \&bar up 5 ht 3 \&.G2 .G1 define bar { "_" } for i = 1 to 10 do { bar at i,i } undefine bar bar up 5 ht 3 .G2 .DE .KE .KS .PP Bruce Lilly tells me that DWB .CW grap defines some macros to make embedding pic code easier. The macros are named .CW x_ .I coordname , .CW y_ .I coordname , and .CW xy_ .I coordname . The first 2 return a pic location corresponding to that x or y coordinate in the given name space. The third generates a pair of coordinates in the given coordinate space. The default coordinate space is given by .CW x_gg , .CW y_gg , and .CW xy_gg . If you define a coordinate space named gg, the macros will map one or the other, but I don't know which. .PP DWB .CW grap may use these as part of their implementation. They're an extra feature for compatibility here. .PP Here's a simple example of using these. Note that the fors loop are pic for loops. You don't have access to grap variables from pic. .DS .ft CW \&.G1 \&coord test x 0, 10 y 0, 10 \&coord x 0, 20 y 0, 20 \&frame \&ticks bot on test \&ticks left on test \&pic for i = 0 to 9 do { \&pic "x" at Frame.Origin + xy_test(i,i) \&pic } \&pic for i = 0 to 9 do { \&pic "o" at Frame.Origin + xy_gg(1,i) \&pic } \&.G2 .G1 coord test x 0, 10 y 0, 10 coord x 0, 20 y 0, 20 frame ticks bot on test ticks left on test pic for i = 0 to 9 do { pic "x" at Frame.Origin + xy_test(i,i) pic } pic for i = 0 to 9 do { pic "o" at Frame.Origin + xy_gg(1,i) pic } .G2 .DE .KE .KS .PP A demo of .I grap 's ability to directly manipulate label and plotting sizes. The data is all in the graph specification. .EQ delim off .EN .DS .ft CW \&.G1 \&frame ht 2 wid 2 \&coord x 0,100 y 0,100 \&grid bot dotted from 20 to 80 by 20 "%g" size +5 \&grid left dotted from 20 to 80 by 20 "%g" size -3 \& \&"Text above" above at 50,50 \&"Text rjust " rjust at 50,50 \&bullet at 80,90 \&vtick at 80,80 \&box at 80,70 \× at 80,60 \& \&circle at 50,50 \&circle at 50,80 radius .25 \&line dashed from 10,90 to 30,90 \&arrow from 10,70 to 30,90 \& \&draw A solid \&draw B dashed delta size 15 \&next A at 10,10 \&next B at 10,20 \&next A at 50,20 \&next A at 90,10 \&next B at 50,30 \&next B at 90,30 \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame ht 2 wid 2 coord x 0,100 y 0,100 grid bot dotted from 20 to 80 by 20 "%g" size +5 grid left dotted from 20 to 80 by 20 "%g" size -3 "Text above" above at 50,50 "Text rjust " rjust at 50,50 bullet at 80,90 vtick at 80,80 box at 80,70 times at 80,60 circle at 50,50 circle at 50,80 radius .25 line dashed from 10,90 to 30,90 arrow from 10,70 to 30,90 draw A solid draw B dashed delta size 15 next A at 10,10 next B at 10,20 next A at 50,20 next A at 90,10 next B at 50,30 next B at 90,30 .G2 .KE .bp .EQ delim $$ .EN .PP .KS .PP A gratuitous color graph. Don't ever produce anything this ugly. The data is the 400m times used earlier. There's a circle to show the color and fillcolor attributes. I've also added a thickness to one line and the circle. .EQ delim off .EN .DS .ft CW \&.G1 \&frame invis ht 2 wid 3 left solid color "blue" \\ \& bot solid color "orange" \&label left "Time (in seconds)" left .15 \&label bot "Olympic 400 Meter Run: Winning Times" \&coord x 1894, 1994 y 42, 56 \&ticks left out at 44 , 46 "", 48, 50 "", 52, 54 "" \&ticks bot in from 1900 to 1980 by 20 \&grid bot ticks off color "yellow" from 1900 to 1980 by 20 \&grid left ticks off color "yellow" at 44, 46, 48, 50, 52, 54 \&draw solid color "green" delta color "violet" \© "400mpairs.d" \&new color "red" thickness 2.5 \© "400wpairs.d" \&"Women" size -3 at 1958,52 \&"Men" size -3 at 1910,47 \&circle at 1940, 52 rad 0.25 color "blue" fillcolor "red" \\ \& fill 0.5 thickness 2 \&.G2 .ft .DE .EQ delim $$ .EN .G1 frame invis ht 2 wid 3 left solid color "blue" \ bot solid color "orange" label left "Time (in seconds)" left .15 label bot "Olympic 400 Meter Run: Winning Times" coord x 1894, 1994 y 42, 56 ticks left out at 44 , 46 "", 48, 50 "", 52, 54 "" ticks bot in from 1900 to 1980 by 20 grid bot ticks off color "yellow" from 1900 to 1980 by 20 grid left ticks off color "yellow" at 44, 46, 48, 50, 52, 54 draw solid color "green" delta color "violet" copy "400mpairs.d" new color "red" thickness 2.5 copy "400wpairs.d" "Women" size -3 at 1958,52 "Men" size -3 at 1910,47 circle at 1940, 52 rad 0.25 color "blue" fillcolor "red" \ fill 0.5 thickness 2 .G2 .KE .bp .PP Some people have tripped over .CW grap 's fairly limited string manipulation capabilities. Simply .CW grap can only compare two quoted strings for equality. Strings cannot be assigned to variables. Surprisingly, when combined with macros, that's enough to do simple data selection, but not much more. Here's an example. .KS .EQ delim off .EN .DS .ft CW \&.G1 \© until "END" thru { \& if ( "$1" == "yes" ) then { \& next at $2, $3 \& } \&} \&yes 1 1 \&yes 2 2 \&no 3 3 \&yes 4 4 \&yes 5 5 \&END \&.G2 .ft .DE .G1 copy until "END" thru { if ( "$1" == "yes" ) then { next at $2, $3 } } yes 1 1 yes 2 2 no 3 3 yes 4 4 yes 5 5 END .G2 .KE .LP Note that while data files can contain quotes, putting quotes in the data file will .B not collect words into strings containing whitespace; .CW grap splits lines of data files into words separated by whitespace. .CW Grap 's macro substitution and line splitting are very literal and know nothing about the language structure. Overall, if you're planning anything more complex than conditionals based on the contents of a single word parameter to a macro call, do it outside .CW grap . .CW Perl and other scripting languages make complex text manipulations very easy. Here's the same example with quotes in the file; notice the change in the expression in the .CW if . .KS .EQ delim off .EN .DS .ft CW \&.G1 \© until "END" thru { \& if ( $1 == "yes" ) then { \& next at $2, $3 \& } \&} \&"yes" 1 1 \&"yes" 2 2 \&"no" 3 3 \&"yes" 4 4 \&"yes" 5 5 \&END \&.G2 .ft .DE .G1 copy until "END" thru { if ( $1 == "yes" ) then { next at $2, $3 } } "yes" 1 1 "yes" 2 2 "no" 3 3 "yes" 4 4 "yes" 5 5 END .G2 .KE .bp .LP This demonstrates the .CW grap features for manipulating dates by plotting a histogram of automobile gas mileage. The fields of the data are a date in yyymmdd format, an odometer reading and the number of gallons on fill up. The .CW strptime function is used to convert the ad hoc date format into a plottable number, and .CW strptime is used to label ticks. .KS .EQ delim off .EN .DS .ft CW \&.G1 \&max_mpg = last_date = last_miles = mn = mx = 0 \© until "END" thru { \& # parse the date into seconds \& dt = strptime("%Y%m%d", "$1") \& if mn == 0 || dt < mn then { mn = dt } \& if mx == 0 || dt > mx then { mx = dt } \& if last_miles != 0 then { \& mpg = ($2 - last_miles)/$3 \& if mpg > max_mpg then { max_mpg = mpg } \& bar up (last_date + dt) / 2 ht mpg wid dt -last_date \& } \& last_miles = $2; last_date = dt \&} \&20100623 34794 9.845 \&[...] \&20111119 42802 9.539 \&END \&for t from mn to mx by (mx - mn )/3 do { \& tick bot at t strftime("%Y-%m-%d", t) \&} \&label left "Miles per gallon" \&label bot "Dates" \&.G2 .ft .DE .G1 max_mpg = last_date = last_miles = mn = mx = 0 copy until "END" thru { # parse the date into seconds dt = strptime("%Y%m%d", "$1") if mn == 0 || dt < mn then { mn = dt } if mx == 0 || dt > mx then { mx = dt } if last_miles != 0 then { mpg = ($2 - last_miles)/$3 if mpg > max_mpg then { max_mpg = mpg } bar up (last_date + dt) / 2 ht mpg wid dt -last_date } last_miles = $2; last_date = dt } 20100623 34794 9.845 20100710 35066 9.804 20100728 35339 9.785 20100811 35623 10.026 20100826 35919 10.086 20100912 36192 9.536 20101001 36472 9.759 20101024 36737 9.848 20101113 37004 9.827 20101129 37257 9.806 20101218 37521 10.211 20110108 37774 9.868 20110122 38036 10.295 20110208 38293 9.693 20110220 38564 9.567 20110306 38817 9.577 20110325 39087 10.090 20110406 39350 9.893 20110422 39620 9.975 20110507 39913 10.089 20110522 40149 8.428 20110614 40411 10.007 20110702 40696 9.842 20110719 40982 10.219 20110806 41224 8.710 20110828 41510 9.775 20110917 41745 8.142 20111005 42018 9.841 20111019 42287 9.886 20111108 42545 9.732 20111119 42802 9.539 END for t from mn to mx by (mx - mn )/3 do { tick bot at t strftime("%Y-%m-%d", t) } label left "Miles per gallon" label bot "Dates" .G2 .KE grap-1.49/examples/army.d0000664000175000017500000000044114546364223012266 0000000000000040 17 0.9 249 1 42 190 12 2867 1 43 521 36 6358 55 44 692 48 7144 71 45 773 63 7284 91 46 241 17 1606 17 50 63 4 512 7 55 106 5 977 8 60 87 4 762 8 65 98 3 846 9 70 138 5 1141 11 75 85 5 641 38 80 78 7 613 61 85 84 11 599 68 90 80 12 567 73 91 77 12 564 71 92 74 12 496 65 93 66 10 443 57 grap-1.49/examples/result.SQ_MESH.Fail1.S3.R0.Hybrid.Random1500.succ.result0000664000175000017500000000011414546364223022462 00000000000000270 97.358 121.811 616 88.838 109.360 777 75.579 113.143 858 44.126 111.896 grap-1.49/examples/states3.d0000664000175000017500000000054514546364223012711 00000000000000WY 0 0 AK 0 1 VT 0 2 ND 0 3 DE 0 4 SD 0 5 MT 0 6 RI 1 0 ID 1 1 HI 1 2 NH 1 3 NV 1 4 ME 1 5 NM 1 6 NE 1 7 UT 1 8 WV 1 9 AR 2 0 KS 2 1 MS 2 2 IA 2 3 OR 2 4 OK 3 0 CT 3 1 CO 3 2 SC 3 3 AZ 3 4 KY 3 5 AL 4 0 LA 4 1 MN 4 2 MD 4 3 WA 4 4 TN 4 5 WI 4 6 MO 5 0 IN 5 1 MA 6 0 VA 6 1 GA 6 2 NC 6 3 NJ 7 0 MI 9 0 OH 10 0 IL 11 0 PA 11 1 FL 12 0 TX 16 0 NY 17 0 CA 29 0 grap-1.49/examples/result.SQ_MESH.Fail1.S3.R0.Local.Random1500.succ.result0000664000175000017500000000011414546364223022273 00000000000000270 88.136 124.610 616 67.455 115.707 777 45.545 114.643 858 18.587 112.161 grap-1.49/examples/Makefile0000664000175000017500000000055414546364223012616 00000000000000# This file is (c) 1998 Ted Faber (faber@lunabase.org) see COPYRIGHT # for the full copyright and limitations of liabilities. MACROS=-ms example.ps: example.ms grap example.ms | groff -pe $(MACROS) > example.ps local.example.ps: example.ms ../grap -d ../grap.defines example.ms | groff -pe $(MACROS) > local.example.ps clean: rm -f *.ps *.pdf *.ps.gz *core grap-1.49/examples/usapop.d0000664000175000017500000000027314546364223012630 000000000000001790 3.93 1800 5.31 1810 7.24 1820 9.64 1830 12.86 1840 17.06 1850 23.19 1860 31.44 1870 38.56 1880 50.19 1890 62.98 1900 76.21 1910 92.23 1920 106.02 1930 123.20 1940 132.16 1950 151.33 grap-1.49/examples/states2.d0000664000175000017500000000010314546364223012676 000000000000000 7 1 10 2 5 3 6 4 7 5 2 6 4 7 1 9 1 10 1 11 2 12 1 16 1 17 1 29 1 grap-1.49/examples/400wpairs.d0000664000175000017500000000012214546364223013043 000000000000001964 52 1968 52 1972 51.08 1976 49.29 1980 48.88 1984 48.83 1988 48.95 1992 48.83 grap-1.49/examples/result.SQ_MESH.Fail1.S3.R0.Global.Random1500.succ.result0000664000175000017500000000011414546364223022441 00000000000000270 94.619 108.211 616 92.083 105.421 777 77.489 107.958 858 49.073 116.177 grap-1.49/examples/400mtimes.d0000664000175000017500000000016214546364223013040 0000000000000054.2 49.4 49.2 50 48.2 49.6 47.6 47.8 46.2 46.5 46.2 45.9 46.7 44.9 45.1 43.8 44.66 44.26 44.60 44.27 43.87 43.50 grap-1.49/examples/boyhts.d0000664000175000017500000000045214546364223012630 000000000000002 32.2 33.8 36.6 3 35.0 37.4 40.2 4 37.7 40.6 43.4 5 40.2 43.4 46.1 6 42.5 45.7 48.6 7 44.5 47.9 51.0 8 46.5 50.0 53.4 9 48.4 52.0 55.7 10 50.3 54.0 58.2 11 52.1 56.4 60.8 12 54.1 58.8 63.8 13 56.0 61.5 66.5 14 58.5 64.1 69.2 15 61.0 66.4 71.5 16 63.4 68.2 72.9 17 64.8 69.4 73.6 18 65.2 69.5 73.8 grap-1.49/examples/prof2.d0000664000175000017500000000030414546364223012344 00000000000000 39.0 mcount 6.6 _strlen 6.0 _yylex__Fv 5.2 _write 4.6 _yyparse__Fv 2.6 ___as__6StringRC6String 2.5 ___13DisplayStringG6Stringidi 2.5 _malloc_bytes 2.1 __IO_dtoa grap-1.49/grap.defines0000664000175000017500000000077414546364223011634 00000000000000.G1 .\" This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT .\" for the full copyright and limitations of liabilities. define delta {"\(*D" size 8} define bullet {"\v'0.1m'\(bu\v'-0.1m'" size 9} define vtick {"|" size 8} define square {"\(sq" size 8} .\"define box {"\f(ZD\s8\N'110'\s0\fP"} define box {"\f(ZD\N'110'\fP" size 8} define times {"\(mu" size 8} define htick {"\(em" size 8} define plus {"\(pl" size 8} define star {"\(**" size 8} define dot {"\v'-0.2m'.\v'0.2m'" size 8} .G2 grap-1.49/install-sh0000775000175000017500000001273614546364223011351 00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 grap-1.49/grap_pic.h0000664000175000017500000001274114546364223011276 00000000000000// -*-c++-*- #ifndef GRAP_PIC_H #define GRAP_PIC_H // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. extern void linenum(); // This is used by Pictick and Picgrid to iterate across their shifts class Picshiftdraw : unary_function { protected: ostream &f; // The output ostream public: Picshiftdraw(ostream& ff) : f(ff) { } int operator()(shiftdesc *sd) { if ( sd->param != 0 ) { f << "move " ; switch (sd->dir) { case left_side: f << "left "; break; case right_side: f << "right "; break; case top_side: f << "up "; break; case bottom_side: f << "down "; break; } f << sd->param << endl; } return 1; } }; class PicDisplayString : public DisplayString, public drawable { public: PicDisplayString(DisplayString& ds) : DisplayString(ds) { } void draw(frame *); ~PicDisplayString() { }; }; class Pictick : public tick, public drawable { public: Pictick(tick& t) : tick(t) { }; void draw(frame *); ~Pictick() { } }; class Picgrid: public grid, public drawable { public: Picgrid(grid &g) : grid(g) { } void draw(frame *); ~Picgrid() { } }; class Picframe: public frame, public drawable { public: void draw(frame *) ; ~Picframe() { } protected: void autoguess(sides, double &, double&, double&, double &, int&, coord *); void addautoticks(sides); void addautogrids(sides); void frame_line(double, double, sides); void label_line(sides); }; class Piclinesegment : public linesegment, public drawable { protected: // Returns true if the coordinate is between 0 and 1 (withing tolerance). inline bool inbox(double a) { return ( a < 1+epsilon && a > 0-epsilon ); } bool clipx( double &, double &, double &, double &); bool clip( double &, double &, double &, double &); public: Piclinesegment(linesegment &ls) : linesegment(ls) { } Piclinesegment(double x, double y, coord* c, line *l, DisplayString *s=0, linedesc *ld=0, bool a=false) : linesegment(x, y, c, l, s, ld, a) { } ~Piclinesegment() { } void draw(frame *); }; // Sequence is defined in grap_data.h class Picplot: public plot, public drawable { public: Picplot(plot& p) : plot(p) { } Picplot(stringlist *s =0, point *p=0) : plot(s, p) { } ~Picplot() { } void draw(frame *); }; class Piccircle: public circle, public drawable { public: Piccircle(circle& c) : circle(c) { } Piccircle(point *p, double r, linedesc *l=0) : circle(p, r, l) { } ~Piccircle() { } void draw(frame *); }; class Picbox: public box, public drawable { protected: void swap(double &a, double &b) { double h = a; a =b ; b =h; } public: Picbox(box& b) : box(b) { } Picbox(point *p1, point *p2, linedesc *l) : box(p1, p2, l) { } ~Picbox() { } void draw(frame *); }; class Picthrustring : public string, public drawable { public: Picthrustring(const string &s) : string(s) { } ~Picthrustring() { } void draw(frame *) { cout << *this << endl; } }; class Picgraph : public graph { string *ps_param; // The params to .G1 string *pos; // the position of the graph (in pic) int graphs; // the number of graphs drawn this block bool frame_queued; // The frame is on the object list Picframe *pframe; // The pic frame for deallocation public: // regular member functions Picgraph() : graph(), ps_param(0), pos(0), graphs(0), pframe(0) { } ~Picgraph() { // pframe should always be a copy of base, so don't delete it. // It will be deallocated by graph::init. delete ps_param; ps_param = 0; delete pos; pos = 0; } // overload the virtual functions in graph void init(string * =0, string* =0); void begin_block(string *param) { graphs = 0; ps_param = param; } void end_block() { if ( graphs ) { cout << ".PE" << endl; linenum(); } } void passthru_string(const string& s) { Picthrustring *t = new Picthrustring(s); if ( t ) objs.push_back(t); } virtual linesegment *new_linesegment(double x, double y, coord* c, line *l, DisplayString *s=0, linedesc *ld=0, bool a=false) { Piclinesegment *pls = new Piclinesegment(x, y, c, l, s, ld, a); queue_frame(); if (pls) objs.push_back(pls); return pls; } virtual plot *new_plot(stringlist *s =0, point *p=0) { Picplot *pl = new Picplot(s, p); queue_frame(); if ( pl ) objs.push_back(pl); return pl; } virtual circle *new_circle(point *p, double r, linedesc *l=0) { Piccircle *c = new Piccircle(p, r, l); queue_frame(); if ( c ) objs.push_back(c); return c; } virtual box *new_box(point *p1, point *p2, linedesc *l) { Picbox *b = new Picbox(p1, p2, l); queue_frame(); if ( b ) objs.push_back(b); return b; } virtual void queue_frame() { if ( !frame_queued ) { objs.push_back(pframe); frame_queued = true; } } void draw(frame *); }; class Piccoord: public coord, public drawable { public: Piccoord(const coord& c) : coord(c) { } ~Piccoord() { } void draw(frame *f) { const string& nm = (name != "") ? name : "gg"; cout << "define x_"<< nm << " { ((( $1 - " << xmin << ") / " << xmax-xmin << ") * " << f->wid << " ) }" << endl; cout << "define y_"<< nm << " { ((( $1 - " << ymin << ") / " << ymax-ymin << ") * " << f->ht << " ) }" << endl; cout << "define xy_" << nm << " { x_" << nm << "($1), " << "y_"<< nm << "($2) }" << endl; } }; #endif grap-1.49/README0000664000175000017500000001057214546364223010221 00000000000000This is grap, an implementation of Kernighan and Bentley's grap language for typesetting graphs. I got sick of groff not having a version of grap, so I built one. The code is distributed under the FreeBSD-style copyright: Copyright 1998-2009 Ted Faber All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. That text is reproduced in the COPYRIGHT file, too. Changes are in CHANGES. The code was all written by me, based on K&B's _Grap-A Language for Typesetting Graphs, Tutorial and User Manual_ by Jon L. Bentley and Brian W. Kernighan, revised May 1991. That paper is available from http://www.kohala.com/start/troff/troff.html as http://www.kohala.com/start/troff/cstr114.ps . You should check out the paper for a complete understanding of grap's power. grap is a pic preprocessor, so any typesetting language that can use pic can use grap. I believe that TeX can use pic, but I wouldn't be surprised if grap.defines needs to be fooled with. If you use TeX and find a set of grap.defines that work, please let me know. Some people have used the given grap.tex.defines. Modifications always welcome. If you want to generate a GNU makefile when the system make command is not GNU make, use the --enable-force-gnu-make option to configure. configure does it's best to tell if you have GNU make and create an appropriate make file, but can be confused. The man page uses the BSD macros. If your system doesn't, there's an ASCII version in grap.man, and a postscript version in grap.ps. Check out the examples in the examples directory. So far I've compiled the code on Sunos 4.1.3, Solaris 5.5.1, FreeBSD 2.2.7-4.2, and an unknown RedHat Linux 6.1. It may run under other systems, and your c++ compiler and yacc/lex versions are probably more important than the type of Unix you run. Flex 2.5.4 and the yacc on FreeBSD 2.2.7 are known to work as well as later versions of bison. g++ 2.7.2.1, 2.8.1 2.95.1 and 2.95.2 have all worked. grap uses the standard template library, so that may also be a factor. The STL included with g++ works. grap has successfully compiled under UWIN (http://www.research.att.com/sw/tools/uwin/) under Windows NT with g++ 2.95.1. (Yeah, it surprised me, too.) Grap has been reported to build and install correctly on OpenBSD as well. The distribution uses GNU configure. ./configure should create a viable set of makefiles. After running configure, you should be able to use make directly (specifically, make depend && make). The resulting makefile should run under most versions of make, including GNU make and FreeBSD's pmake. If you want to run the GNU autoconf tools yourself, well, $DIETY help you, but I found: $ aclocal && autoheader && automake --add-missing && autoconf is a good starting point. If you try to compile grap on a new system and have problems, let me know and I'll try to help. If you succeed, let me know. Bug reports or other correspondence to faber@lunabase.org. This program is a hobby, so understand that bug reports will be handled as I have time. The most recent stable version should always be available at http://www.lunabase.org/~faber/Vault/software/grap/ . If you're having a problem, don't hesitate to mail, because I often have a slightly pre-release version with in-progress bug fixes too. grap-1.49/ChangeLog0000664000175000017500000000006714546364223011111 00000000000000See CHANGES (automake barfs if this file isn't around) grap-1.49/grap.yy0000664000175000017500000007253414546364223010663 00000000000000/* -*-c++-*- */ %{ /* This code is (c) 1998-2001 Ted Faber (faber@lunabase.org) see the COPYRIGHT file for the full copyright and limitations of liabilities. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifdef STDC_HEADERS #include #endif #if defined(STDC_HEADERS) | defined(HAVE_STDLIB_H) #include #endif #ifdef HAVE_UNISTD_H #include #endif // We use RAND_MAX to scale random()/rand() values into doubles below. // This is a little defensive driving to find a usable value for it. #ifndef RAND_MAX #ifdef LONG_MAX #define RAND_MAX LONG_MAX #else // Shot in the dark, really - stdlib.h or limits.h should exist #define RAND_MAX 0x7fffffffL #endif #endif #include "grap.h" #include "grap_data.h" #include "grap_draw.h" doubleDictionary vars; graph *the_graph =0; lexStack lexstack; macroDictionary macros; stringSequence path; bool first_line; bool unaligned_default = false; // Should strings be unaligned by default bool clip_default = true; // Should strings be clipped by default extern bool do_sprintf; // true if it's acceptable to parse sprintf line* defline; coord *defcoord; string *graph_name; string *graph_pos; string *ps_param; // number of lines in a number list (used in grap_parse.cc) int nlines; // bison wants these defined.... int yyerror(const char*); int yylex(); void init_dict(); // defined in grap_lex.l extern bool include_file(string *, bool =false, bool=true); extern void lex_no_macro_expansion(); extern void lex_macro_expansion_ok(); extern void lex_begin_macro_text(); extern void lex_begin_rest_of_line(); extern void lex_no_coord(); extern void lex_coord_ok(); extern void lex_begin_copy( string*s=0); extern int include_string(string *, for_descriptor *f=0, grap_input i=GMACRO); extern void lex_hunt_macro(); extern int yyparse(void); // To shut yacc (vs. bison) up. void draw_graph(); void init_graph(); // Parsing utilities in grap_parse.cc. Locating them there reduces // compilation time (this file was getting very large) and eliminates // some code redundancy. extern graph *initial_graph(); extern linedesc* combine_linedesc(linedesc *, linedesc*); extern axis combine_logs(axis, axis); extern void draw_statement(string *, linedesc *, DisplayString *); extern void num_list(doublelist *); extern double assignment_statement(string *, double); extern stringlist *combine_strings(stringlist *, string *, strmod &); extern void plot_statement(double, DisplayString *, point *); extern void next_statement(string *, point *, linedesc *); extern ticklist *ticklist_elem(double, DisplayString *, ticklist *); extern ticklist *tick_for(coord *, double, double, bydesc, DisplayString *); extern void ticks_statement(sides, double, shiftlist *, ticklist *); extern void grid_statement(sides, int, linedesc *, shiftlist *, ticklist *); extern void line_statement(int, linedesc *, point *, point *, linedesc *); extern axisdesc axis_description(axis, double, double ); extern void coord_statement(string *, axisdesc&, axisdesc&, axis); extern void coord_statement(coord *, axisdesc&, axisdesc&, axis); extern void for_statement(string *, double, double, bydesc, string *); extern void process_frame(linedesc *, frame *, frame *); extern void define_macro(string *, string*); extern void bar_statement(coord *, sides, double, double, double, double, linedesc *); // adapters to return complex (complex-ish) functions void grap_srandom(double x) { srandom(static_cast(x)); } double grap_random() { return static_cast(random())/(static_cast(RAND_MAX)+1e-6); } double grap_getpid() { return static_cast(getpid());} double pow10(double x) { return pow(10,x); } double toint(double x) { return static_cast(int(x)); } double grap_min(double a, double b) { return (ab) ? a : b; } typedef void (*vfunction1)(double); typedef double (*function0)(); typedef double (*function1)(double); typedef double (*function2)(double, double); // jump tables for dispatching internal functions vfunction1 jtvf1[NVF1] = { grap_srandom }; function0 jtf0[NF0] = { grap_random, grap_getpid }; function1 jtf1[NF1] = { log10, pow10, toint, sin, cos, sqrt, exp, log, floor, ceil }; function2 jtf2[NF2] = { atan2, grap_min, grap_max}; %} %token NUMBER START END IDENT COPY SEP STRING COORD_NAME UNDEFINE %token SOLID INVIS DOTTED DASHED DRAW LPAREN RPAREN FUNC0 FUNC1 FUNC2 COMMA %token LINE PLOT FROM TO AT NEXT FRAME LEFT RIGHT TOP BOTTOM UP DOWN HT WID %token IN OUT NONE TICKS OFF BY GRID LJUST RJUST ABOVE BELOW ALIGNED %token PLUS MINUS TIMES DIV CARAT EQUALS SIZE UNALIGNED LABEL RADIUS CIRCLE %token ARROW XDIM YDIM LOG_X LOG_Y LOG_LOG COORD TEXT DEFINE IF THEN ELSE %token EQ NEQ LT GT LTE GTE NOT OR AND FOR DO MACRO COPYTEXT THRU %token GRAPH REST PRINT PIC TROFF UNTIL COLOR SPRINTF SH BAR FILL FILLCOLOR %token BASE ON LHS VFUNC1 CLIPPED UNCLIPPED THICKNESS MOD STRPTIME %token STRFTIME %start graphs %union { int val; double num; string *String; DisplayString *ds; frame *frameptr; shiftdesc *shift; shiftlist *shift_list; point *pt; linedesc *lined; stringlist *string_list; linelist *line_list; ticklist *tick_list; doublelist *double_list; doublevec *double_vec; macro *macro_val; coord *coordptr; line *lineptr; sides side; bydesc by; axisdesc axistype; axis axisname; strmod stringmod; copydesc *copyd; bar_param *bar_p; } %type NUMBER num_line_elem expr opt_expr direction radius_spec %type assignment_statement lexpr pure_lexpr right_hand_side time_expr %type strmod %type IDENT STRING opt_ident TEXT else_clause REST TROFF %type START string LHS %type opt_display_string %type VFUNC1 FUNC0 FUNC1 FUNC2 tickdir opt_tick_off line_token %type opt_coordname COORD_NAME autotick %type side bar_dir %type sides size size_elem final_size %type linedesc_elem linedesc opt_linedesc %type strlist %type num_line %type expr_list %type ticklist tickat tickfor tickdesc %type point coord_pair %type opt_shift %type shift %type by_clause %type x_axis_desc y_axis_desc %type log_list log_desc %type COPYTEXT %type MACRO %type until_clause %type bar_param bar_params %left OR AND %right NOT %left EQ NEQ LT GT LTE GTE %left PLUS MINUS %left TIMES DIV MOD %left CARAT %% graphs: | graphs graph ; graph : START { if ( !the_graph) the_graph = initial_graph(); the_graph->init(); init_dict(); first_line = true; the_graph->begin_block($1); } prog END { the_graph->draw(0); the_graph->end_block(); } ; prog : { } | prog statement { } ; statement: assignment_statement { first_line = false;} | num_list { first_line = false; the_graph->is_visible(true);} | frame_statement { first_line = false; the_graph->queue_frame(); the_graph->is_visible(true); } | draw_statement { first_line = false; } | next_statement { first_line = false; the_graph->is_visible(true);} | plot_statement { first_line = false; the_graph->is_visible(true);} | ticks_statement { first_line = false; the_graph->is_visible(true);} | grid_statement { first_line = false; the_graph->is_visible(true);} | label_statement { first_line = false; the_graph->is_visible(true);} | circle_statement { first_line = false; the_graph->is_visible(true);} | bar_statement { first_line = false; the_graph->is_visible(true);} | line_statement { first_line = false; the_graph->is_visible(true);} | coord_statement { first_line = false;} | copy_statement { first_line = false;} | define_statement { first_line = false;} | undefine_statement { first_line = false;} | if_statement { first_line = false;} | for_statement { first_line = false;} | graph_statement { first_line = false;} | print_statement { first_line = false;} | sh_statement { first_line = false;} | pic_statement { first_line = false;} | troff_line { first_line = false;} | void_function { first_line = false;} | SEP ; from: FROM | EQUALS ; opt_coordname: { $$= defcoord; } | COORD_NAME { $$= $1;} ; opt_ident: { $$ = 0; } | IDENT { $$ = $1; } ; opt_display_string: { $$ = 0; } | string strmod { $$ = new DisplayString(*$1, $2.just, $2.size, $2.rel, $2.clip, $2.color); } ; string: STRING { $$ = $1; } | SPRINTF LPAREN STRING COMMA expr_list RPAREN { if ( do_sprintf ) { const int len = $3->length() < 128 ? 256 : 2*$3->length(); char *buf = new char[len]; // I really dislike this, but I dislike trying to do it // incrementally more. switch ($5->size()) { case 0: snprintf(buf, len, "%s", $3->c_str()); break; case 1: snprintf(buf, len, $3->c_str(), (*$5)[0]); break; case 2: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1]); break; case 3: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2]); break; case 4: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3]); break; case 5: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3], (*$5)[4]); break; case 6: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3], (*$5)[4], (*$5)[5]); break; case 7: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3], (*$5)[4], (*$5)[5], (*$5)[6]); break; case 8: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3], (*$5)[4], (*$5)[5], (*$5)[6], (*$5)[7]); break; case 9: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3], (*$5)[4], (*$5)[5], (*$5)[6], (*$5)[7], (*$5)[8]); break; default: cerr << "more that 10 arguments to sprintf. " << "Ignoring more than 10." << endl; case 10: snprintf(buf, len, $3->c_str(), (*$5)[0], (*$5)[1], (*$5)[2], (*$5)[3], (*$5)[4], (*$5)[5], (*$5)[6], (*$5)[7], (*$5)[8], (*$5)[9]); break; } delete $5; delete $3; $$ = new string(buf); delete[] buf; } else $$ = $3; } | STRFTIME LPAREN string COMMA expr RPAREN { time_t t = $5; struct tm *tm = localtime(&t); const int len = 1024; char *buf = new char[len]; bool ok = false; if (tm) { if (strftime(buf, len, $3->c_str(), tm) != 0 ) { $$ = new string(buf); delete buf; ok = true; } } if ( !ok) { delete buf; cerr << "Cannot format " << $5 << " using format " << *$3 << endl; $$ = new string("error"); } } ; expr_list: expr { $$ = new doublevec; $$->push_back($1); } | expr_list COMMA expr { $$ = $1; $$->push_back($3); } ; opt_expr: { $$ = 0; } | expr { $$ = $1; } ; opt_linedesc: { $$ = new linedesc; $$ = 0;} | linedesc { $$ = $1;} ; opt_shift: { $$ = new shiftlist;} | shift opt_shift { $$ = $2; $$->push_back($1); } ; linedesc_elem: INVIS { $$ = new linedesc(invis); } | SOLID { $$ = new linedesc(solid); } | DOTTED opt_expr { $$ = new linedesc(dotted, $2); } | DASHED opt_expr { $$ = new linedesc(dashed, $2); } | COLOR string { $$ = new linedesc(def, 0, $2); } | FILL opt_expr { $$ = new linedesc(def, 0, 0, $2); } | FILLCOLOR string { $$ = new linedesc(def, 0, 0, 0, $2); } | THICKNESS opt_expr { $$ = new linedesc(def, 0, 0, 0, 0, $2); } ; linedesc: linedesc_elem { $$ = $1; } | linedesc linedesc_elem { $$ = combine_linedesc($1, $2); } ; draw_statement: DRAW { lex_no_coord(); } opt_ident opt_linedesc opt_display_string SEP { draw_statement($3, $4, $5); lex_coord_ok(); } ; num_list: num_line SEP { num_list($1); } ; num_line_elem: NUMBER { $$ = $1; } | MINUS NUMBER { $$ = -$2; } ; num_line: num_line_elem { $$ = new doublelist; $$->push_back($1); } | num_line num_line_elem { $$ = $1; $$->push_back($2); } | num_line COMMA num_line_elem { $$ = $1; $$->push_back($3); } ; expr: expr PLUS expr { $$ = $1 + $3; } | expr MINUS expr { $$ = $1 - $3; } | expr TIMES expr { $$ = $1 * $3; } | expr DIV expr { $$ = $1 / $3; } | expr MOD expr { $$ = static_cast($1) % static_cast($3); } | expr CARAT expr { $$ = pow($1,$3);} | MINUS expr %prec CARAT { $$ = - $2;} | FUNC0 LPAREN RPAREN { $$ = ( $1 >=0 && $1 < NF0 ) ? jtf0[$1]() : 0; } | FUNC1 LPAREN expr RPAREN { $$ = ( $1 >=0 && $1 < NF1 ) ? jtf1[$1]($3) : 0; } | FUNC2 LPAREN expr COMMA expr RPAREN { $$ = ( $1 >=0 && $1 < NF2 ) ? jtf2[$1]($3, $5) : 0; } | LPAREN expr RPAREN { $$ = $2; } | time_expr { $$ = $1; } | IDENT { doubleDictionary::iterator di; if ( (di = vars.find(*$1)) != vars.end()) $$ = *(*di).second; else { cerr << *$1 << " is uninitialized, using 0.0" << endl; $$ = 0.0; } delete $1; } | NUMBER { $$ = $1; } ; lexpr: expr { $$ = $1; } | LPAREN pure_lexpr RPAREN { $$ = $2; } | pure_lexpr { $$ = $1; } ; pure_lexpr: lexpr EQ lexpr { $$ = ($1 == $3); } | lexpr NEQ lexpr { $$ = ($1 != $3); } | lexpr LT lexpr { $$ = ($1 < $3); } | lexpr GT lexpr { $$ = ($1 > $3); } | lexpr LTE lexpr { $$ = ($1 <= $3); } | lexpr GTE lexpr { $$ = ($1 >= $3); } | lexpr AND lexpr { $$ = ($1 && $3); } | lexpr OR lexpr { $$ = ($1 || $3); } | NOT lexpr %prec PLUS { $$ = ! ( (int) $2); } | string EQ string { $$ = (*$1 == *$3); delete $1; delete $3; } | string NEQ string { $$ = (*$1 != *$3); delete $1; delete $3; } ; right_hand_side: expr SEP { $$ = $1; } | assignment_statement { $$ = $1; } ; assignment_statement: LHS right_hand_side { $$ = assignment_statement($1, $2); } ; coord_pair: expr COMMA expr { $$ = new point($1, $3, 0); } | LPAREN expr COMMA expr RPAREN { $$ = new point($2, $4, 0); } ; point: opt_coordname coord_pair { $$ = new point($2->x, $2->y, $1); delete $2; } ; time_expr: STRPTIME LPAREN string COMMA string RPAREN { struct tm tm = { 0 }; if (strptime($5->c_str(), $3->c_str(), &tm) != 0) { time_t t = mktime(&tm); $$ = t; } else { cerr << "Could not parse time/date " << *$5 << " using format " << *$3 << endl; $$ = 0.0; } } ; strmod: { $$.size = 0; $$.rel =0; $$.just = (unaligned_default) ? unaligned : 0; $$.clip = clip_default; $$.color = 0; } | strmod SIZE expr { $$.size = $3; $$.rel = ($3<0); } | strmod SIZE PLUS expr { $$.size = $4; $$.rel = 1; } | strmod LJUST { $$.just |= (int) ljust; } | strmod RJUST { $$.just |= (int) rjust; } | strmod ABOVE { $$.just |= (int) above; } | strmod BELOW { $$.just |= (int) below; } | strmod ALIGNED { $$.just |= (int) aligned; } | strmod UNALIGNED { $$.just |= (int) unaligned; } | strmod CLIPPED { $$.clip = true; } | strmod UNCLIPPED { $$.clip = false; } | strmod COLOR STRING { $$.color = $3; } ; strlist: string strmod { DisplayString *s; s = new DisplayString(*$1,$2.just,$2.size, $2.rel, $2.clip, $2.color); delete $1; $$ = new stringlist; $$->push_back(s); } | strlist string strmod { $$ = combine_strings($1, $2, $3); } ; plot_statement: strlist AT point SEP { the_graph->new_plot($1,$3); } | PLOT opt_expr opt_display_string AT point SEP { plot_statement($2, $3, $5); } ; next_statement: NEXT opt_ident AT point opt_linedesc SEP { next_statement($2, $4, $5); } ; size_elem: HT expr { $$ = new frame; $$->ht = $2; $$->wid = 0; } | WID expr { $$ = new frame; $$->wid = $2; $$->ht = 0; } ; size: size_elem { $$ = $1; } | size size_elem { $$ = $1; // Fill in non-default ht/wid if ( $2->ht != 0 ) $$->ht = $2->ht; if ( $2->wid != 0 ) $$->wid = $2->wid; } ; side: TOP { $$ = top_side;} | BOTTOM { $$= bottom_side;} | LEFT { $$ = left_side;} | RIGHT { $$ = right_side; } ; final_size: size { // This rule combines the explicit size settings with // the defaults. We create a new frame to have access // to the default sizes without needing to code them // explicitly (they're always implicit in a default // frame). N. B. that frames created by size (and // size_elem) use 0 to indicate no change to the ht or // wid. $$ = new frame; if ( $1->ht != 0) $$->ht = $1->ht; if ( $1->wid != 0) $$->wid = $1->wid; delete $1; } ; sides: side linedesc { $$ = new frame; $$->desc[$1] = *$2; delete $2; } | sides side linedesc { if ( !$1 ) $$ = new frame; else $$ = $1; $$->desc[$2] = *$3; delete $3; } ; /* Though this looks kludgy as Hell, it's about as clean as I can make it. The * problem is that linedescs are composed of lists of linedesc elements, and 2 * linedescs next to each other are impossible to tell apart. So, the global * linedesc for the frame cannot sit next to one of the linedescs for the * sides. for example is 'frame top dotted color "green"' a green frame with a * dotted top or a frame with a dotted green top? Writing a single list rule to * capture that constraint requires you to know where the size elements appear * in that list and life is horrible and complex. If it's even reasonably * tractable. This enumeration captures many of the possibilities that are * sane and minimizes the code complexity. You can't say things like 'frame * wid 3 dotted ht 5' to get a dotted 3x5 frame, but either 'frame dotted ht 3 * wid 5' or 'frame wid 3 ht 5 dotted' work. * This comment is primarily here to prevent me from wasting another hour * trying to clean this up. */ frame_statement: FRAME SEP { process_frame(0, 0, 0); } | FRAME linedesc SEP { process_frame($2, 0, 0); } | FRAME final_size SEP { process_frame(0, $2, 0); } | FRAME sides SEP { process_frame(0, 0, $2); } | FRAME final_size sides SEP { process_frame(0, $2, $3); } | FRAME linedesc sides SEP { process_frame($2, 0, $3); } | FRAME linedesc final_size SEP { process_frame($2, $3, 0); } | FRAME final_size linedesc SEP { process_frame($3, $2, 0); } | FRAME linedesc final_size sides SEP { process_frame($2, $3, $4);} | FRAME final_size linedesc sides SEP { process_frame($3, $2, $4); } ; shift: UP expr { $$ = new shiftdesc(top_side, $2); } | DOWN expr { $$ = new shiftdesc(bottom_side, $2); } | LEFT expr { $$ = new shiftdesc(left_side, $2); } | RIGHT expr { $$ = new shiftdesc(right_side, $2); } ; tickdir: IN { $$ = -1; } | OUT { $$ = 1; } ; direction: { $$ = 0.125; } | tickdir opt_expr { if ( $2 == 0 ) $$ = $1 * 0.125; else $$ = $1 * $2; } ; ticklist: expr opt_display_string { $$ = ticklist_elem($1, $2, 0); } | ticklist COMMA expr opt_display_string { $$ = ticklist_elem($3, $4, $1); } ; by_clause: { $$.op = PLUS; $$.expr = 1; } | BY expr { $$.op = PLUS; if ( $2 != 0.0 ) $$.expr = $2; else $$.expr = 1; } | BY PLUS expr { $$.op = PLUS; $$.expr = $3; } | BY TIMES expr { $$.op = TIMES; $$.expr = $3; } | BY DIV expr { $$.op = DIV; $$.expr = $3; } | BY MOD expr { $$.op = MOD; $$.expr = $3; } ; tickat: AT opt_coordname ticklist { $$ = $3; for (ticklist::iterator t= $3->begin(); t != $3->end(); t++) (*t)->c = $2; } ; tickfor: from opt_coordname expr TO expr by_clause opt_display_string { $$ = tick_for($2, $3, $5, $6, $7); } ; tickdesc : tickat { $$ = $1;} | tickfor { $$= $1; } ; autotick: ON opt_ident { coordinateDictionary::iterator ci; if ( $2 ) { ci = the_graph->coords.find(*$2); if ( ci != the_graph->coords.end()) $$ = (*ci).second; else { yyerror("Name must name a coordinate space"); } } else $$ = 0; } | { $$ = 0; } ; ticks_statement: TICKS side direction opt_shift tickdesc SEP { ticks_statement($2, $3, $4, $5); } | TICKS OFF SEP { for ( int i = 0; i< 4; i++ ) the_graph->base->tickdef[i].size = 0; } | TICKS side OFF SEP { the_graph->base->tickdef[$2].size = 0; } | TICKS side direction autotick SEP { the_graph->base->tickdef[$2].size = $3; if ( $4 ) the_graph->base->tickdef[$2].c = $4; } ; opt_tick_off: { $$ = 0; } | TICKS OFF { $$ = 1; } ; grid_statement: GRID side opt_tick_off opt_linedesc opt_shift tickdesc SEP { grid_statement($2, $3, $4, $5, $6); } | GRID side opt_tick_off opt_linedesc opt_shift autotick SEP { grid_statement($2, $3, $4, $5, 0); // Because turning on a grid on a given side disables // automatic tick generation there, this is sets up // that side with the proper coordinates. if ( $6 ) the_graph->base->griddef[$2].c = $6; } ; label_statement: LABEL side strlist opt_shift SEP { shiftlist *sl = new shiftlist; shiftdesc *sd; for (stringlist::iterator s = $3->begin(); s != $3->end(); s++) if ( ! ((*s)->j & unaligned) ) (*s)->j |= aligned; // Copy the label shifts into the frame while (!$4->empty() ) { sd = $4->front(); $4->pop_front(); sl->push_back(sd); } delete $4; the_graph->base->label[$2]->push_back(new label($3, sl)); } ; radius_spec: { $$ = 0.025; } | RADIUS expr { $$ = $2; } ; circle_statement: CIRCLE AT point radius_spec opt_linedesc SEP { the_graph->new_circle($3,$4,$5); delete $3; delete $5; } ; line_token: LINE { $$ = 1; } | ARROW { $$ = 0; } ; line_statement: line_token opt_linedesc FROM point TO point opt_linedesc SEP { line_statement($1, $2, $4, $6, $7); } ; x_axis_desc: { $$.which=none; } | XDIM expr COMMA expr { $$ = axis_description(x_axis, $2, $4); } ; y_axis_desc: { $$.which=none; } | YDIM expr COMMA expr { $$ = axis_description(y_axis, $2, $4); } ; log_list: log_list log_desc { $$ = combine_logs($1, $2); } | { $$ = none; } ; log_desc: LOG_X { $$ = x_axis; } | LOG_Y { $$ = y_axis; } | LOG_LOG { $$ = both; } ; coord_statement: COORD opt_ident x_axis_desc y_axis_desc log_list SEP { coord_statement($2, $3, $4, $5); delete $2; } ; until_clause: { $$ = 0; } | UNTIL string { unquote($2); $$ = new copydesc; $$->t = copydesc::until; $$->s = $2; } | string { unquote($1); $$ = new copydesc; $$->t = copydesc::fname; $$->s = $1; } ; // This is probably long enough to merit being removed to // grap_parse.cc, but because there are multiple actions in the same // rule, I want to leave them here where I can see how they // interrelate. copy_statement: COPY string SEP { unquote($2); if (!include_file($2, false)) return 0; } | COPY UNTIL string SEP { unquote($3); lex_begin_copy($3); } COPYTEXT { string s=""; while ($6 && !$6->empty() ) { string *ss; ss = $6->front(); $6->pop_front(); if ( ss ) { s+= *ss; s+= '\n'; delete ss; ss = 0; } } include_string(&s, 0, GINTERNAL); delete $6; } | COPY until_clause THRU { lex_hunt_macro(); } MACRO until_clause SEP { copydesc *c = 0; // To shut the compiler up about uninit if ( $2 && $6 ) { delete $2; delete $6; yyerror("Only specify 1 until or filename\n"); } else c = ($2) ? $2 : $6; // The else handles files with neither else clause, copying // text to the trailing .G2. Fix from Bruce Lilly if ( c ) { // lex_begin_copy takes command of the string that's // passed to it, so don't delete it. (I don't // remember why I did that...) if ( c->t == copydesc::until ) { lex_begin_copy(c->s); c->s = 0; } else { lex_begin_copy(0); include_file(c->s, false); } delete c; } else lex_begin_copy(0); } COPYTEXT { string *s; string *t; int lim; char end; stack st; while ( $9 && !$9->empty() ) { int i = 0; t = new string; s = $9->front(); $9->pop_front(); lim = s->length(); while ( i < lim ) { if ( (*s)[i] == ' ' || (*s)[i] == '\t' ) { if ( t->length() ) { if ( $5->add_arg(t)) t = new string; } } else *t += (*s)[i]; i++; } if ( t->length() ) $5->add_arg(t); else if (t) delete t; t = $5->invoke(); // "here" macros should end with a SEP. If the // user hasn't done so, we add a SEP for them. // Even named macros should get a sep when they're // copied through, end = (*t)[t->length()-1]; if ( end != ';' && end != '\n' ) *t += ';'; // Because include string stacks the strings, we stack them // here and call include_string in reverse order to ensure // correct ordered execution of multiple lines. st.push(t); delete s; } delete $9; while ( !st.empty() ) { include_string(st.top(), 0, GMACRO); delete st.top(); st.pop(); } // don't delete defined macros if ( !$5->name) delete $5; } ; define_statement: DEFINE { lex_no_coord(); lex_no_macro_expansion();} IDENT { lex_begin_macro_text(); } TEXT SEP { lex_macro_expansion_ok(); lex_coord_ok(); define_macro($3, $5); } ; undefine_statement: UNDEFINE { lex_no_coord(); lex_no_macro_expansion(); } IDENT SEP { lex_coord_ok(); lex_macro_expansion_ok(); macros.erase(*$3); delete $3; } ; sh_statement: SH { lex_begin_macro_text(); } TEXT SEP { int len = $3->length()+1 ; char *sys = new char [len]; int i=0; int srv = 0; // String to char* while ((sys[i] = (*$3)[i])) i++; delete $3; if ( (srv = system(sys)) ) cerr << "Warn: system returned " << srv << endl; } ; else_clause: { $$ = 0; } | ELSE {lex_begin_macro_text(); } TEXT { // force else clause to end with a SEP *$3+= ';'; $$ = $3; } ; if_statement: IF lexpr THEN { lex_begin_macro_text(); } TEXT else_clause SEP { // force all if blocks to be terminated by a SEP. *$5 += ';'; // We use epsilon in loop tests if ( fabs($2) > epsilon ) include_string($5,0,GINTERNAL); else if ( $6 ) include_string($6,0,GINTERNAL); delete $5; delete $6; } ; for_statement: FOR IDENT from expr TO expr by_clause DO { lex_begin_macro_text(); } TEXT SEP { for_statement($2, $4, $6, $7, $10); delete $2; } ; graph_statement: GRAPH { lex_no_coord(); } IDENT { lex_begin_rest_of_line(); } REST SEP { if ( !first_line ) { // Only draw the graph and clear its internals if // it is visible. This allows a user to declare // things like coordinate spaces before the graph // itself is named. This is a compatibility // feature for DWB grap. if ( the_graph->is_visible() ) { the_graph->draw(0); the_graph->init($3, $5); init_dict(); } else the_graph->setname($3); } else { the_graph->init($3, $5); init_dict(); } if ( $3 ) delete $3; if ( $5 ) delete $5; } ; print_statement: PRINT print_param SEP ; print_param: string { unquote($1); cerr << *$1 << endl; } | expr { cerr << $1 << endl; } ; pic_statement: PIC { lex_begin_rest_of_line(); } REST SEP { the_graph->passthru_string(*$3); delete $3;} ; troff_line: TROFF SEP { the_graph->passthru_string(*$1); delete $1;} ; bar_dir: RIGHT { $$ = right_side; } | UP { $$ = top_side; } ; /* NB: the tokenizer only allows one instance of wid or base or ht per line * (you could have all 3) */ bar_param: HT expr { $$ = new bar_param; $$->ht = $2; $$->have_ht = true; } | WID expr { $$ = new bar_param; $$->wid = $2; } | BASE expr { $$ = new bar_param; $$->base = $2; } ; bar_params: bar_param { $$ = $1; } | bar_params bar_param { $$ = $1; if ( $2 ) { if ($2->have_x ) { $$->x = $2->x; $$->have_x = true; } if ($2->have_ht ) { $$->ht = $2->ht; $$->have_ht = true; } if ( $2->wid != 1.0 ) { $$->wid = $2->wid; } if ( $2->base != 0.0 ) { $$->base = $2->base; } delete $2; } } ; bar_statement: BAR point COMMA point opt_linedesc SEP { // The point parsing has already autoscaled the // coordinate system to include those points. the_graph->new_box($2, $4, $5); delete $2; delete $4; delete $5; } | BAR bar_dir opt_coordname expr bar_params opt_linedesc SEP { if ( !$5 || !$5->have_ht ) { yyerror("bar must have a position and ht "); } else { bar_statement($3, $2, $4, $5->ht, $5->wid, $5->base, $6); } delete $5; } ; void_function: VFUNC1 LPAREN expr RPAREN { if ( $1 >=0 && $1 < NVF1 ) jtvf1[$1]($3); } ; %% grap-1.49/depcomp0000755000175000017500000005602014215102164010675 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # 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 2, 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 . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: grap-1.49/grap.tex.defines0000664000175000017500000000201014546364223012414 00000000000000.G1 # This file adds support for TeX to grap # (assuming that your 'pic' implementation allows that. Eg. the pic program # that comes with the GNU groff package does so) # # # All symbols defined here come standard with LaTeX2e, # with the exception of square and box # # If you want to use these two symbols, you must load the 'amssym' package, # ie. put \usepackage{amssymb} in the preamble of your document. # define delta {"\textrm{\fontsize{8}{0}\selectfont{$\triangle$}}"} define bullet {"\textrm{\fontsize{9}{0}\selectfont{$\bullet$}}"} define vtick {"\textrm{\fontsize{8}{0}\selectfont{$\mid$}}"} define square {"\textrm{\fontsize{8}{0}\selectfont{$\square$}}"} define box {"\textrm{\fontsize{8}{0}\selectfont{$\blacksquare$}}"} define times {"\textrm{\fontsize{8}{0}\selectfont$\times$}"} define htick {"\textrm{\fontsize{8}{0}\selectfont{--}}"} define plus {"\textrm{\fontsize{8}{0}\selectfont{+}}"} define star {"\textrm{\fontsize{8}{0}\selectfont$\star$}"} define dot {"\textrm{\fontsize{8}{0}\selectfont$\cdot$}"} .G2 grap-1.49/grap_draw.h0000664000175000017500000005072214546364223011461 00000000000000// -*-c++-*- #ifndef GRAP_DRAW_H #define GRAP_DRAW_H // This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT // for the full copyright and limitations of liabilities. // Names for the sides of graphs (_side because of globals left(), right()) typedef enum { top_side=0, bottom_side ,left_side, right_side} sides; // Styles of drawing lines typedef enum { solid, dotted, dashed, invis, def } linetype; // The axes of graphs typedef enum { none = 0, x_axis = 1, y_axis = 2, both=3} axis; // Justifications for strings, powers of two so we con combine them typedef enum { ljust = 1, rjust = 2, above = 4, below = 8, aligned = 16, unaligned=32} just; typedef struct { axis which; double min; double max; } axisdesc; typedef struct { double size; int rel; int just; bool clip; string *color; } strmod; class linedesc { // Basic class features for line descriptions: constructors, // destructor, and assignment public: linetype ld; // The basic style double param; // Some styles have parameters e.g., dotted 0.3 double fill; // Used for drawing solids, e.g. box string *color; // The name of a color for the line string *fillcolor ; // The color to fill a solid double thick; // Linethickness linedesc(linetype l=def, double p=0, string *c=0, double f=0, string *fc=0, double ft=0) : ld(l), param(p), fill(f), color(0), fillcolor(0), thick(ft) { if ( c ) color = new string(*c); if ( fc ) fillcolor = new string(*fc); } linedesc(const linedesc *l) { if ( l) { ld = l->ld; param = l->param; fill = l->fill; thick = l->thick; if ( l->color ) color = new string(*l->color); else color = 0; if ( l->fillcolor ) fillcolor = new string(*l->fillcolor); else fillcolor = 0; } else { ld = def; param = 0; color = 0; fillcolor = 0; fill = 0; thick = 0; } } linedesc(const linedesc& ldc) : ld(ldc.ld), param(ldc.param), fill(ldc.fill), color(0), fillcolor(0), thick(ldc.thick) { if ( ldc.color ) color = new string(*ldc.color); if ( ldc.fillcolor ) fillcolor = new string(*ldc.fillcolor); } // Make a new linedescriptor that combines the properties in ld1 and // ld2. linedesc(const linedesc* ld1, const linedesc* ld2) : ld(def), param(0), fill(0), color(0), fillcolor(0), thick(0) { if ( ld1 ) *this = *ld1; if ( ld2 && ld2->ld != def ) { ld = ld2->ld; param = ld2->param; } if ( (thick == 0) && ld2 && ld2->thick ) thick = ld2->thick; if ( ld2 && ld2->color ) color = new string(*ld2->color); } ~linedesc() { if ( color ) { delete color; color = 0; } if ( fillcolor ) { delete fillcolor; fillcolor = 0; } } linedesc& operator=(const linedesc &l) { ld = l.ld; param= l.param; fill = l.fill; thick = l.thick; if ( color ) { delete color; color = 0;} if ( l.color ) color = new string(*l.color); if ( fillcolor ) { delete fillcolor; fillcolor = 0;} if ( l.fillcolor ) fillcolor = new string(*l.fillcolor); return *this; } } ; class shiftdesc { // Basic class features for shift descriptions: constructors, // destructor, and assignment public: sides dir; // Direction to shift this label double param; // Amount to shift shiftdesc(sides s=top_side, double p=0) : dir(s), param(p) { } shiftdesc(const shiftdesc *sh ) { if ( sh ) { dir = sh->dir; param = sh->param; } else { dir = top_side; param = 0; } } }; // This functor copies one shiftlist into another, making copies of // each shiftdesc on the list. It's used by various objects that have // shiftlists in them. Each element is inserted at the back class shiftcpy : public unary_function { protected: shiftlist *s; // The new shiftlist public: shiftcpy(shiftlist *ss) : s(ss) { } int operator() (shiftdesc *sd) { shiftdesc *sd2 = new shiftdesc(sd); s->push_back(sd2); return 1; } }; class frame; // An abstract class that means that an object is drawable, and // provides a method with which to draw itself. Drawing is always // relative to a frame. Because drawable classes are managed by the // graph structure, drawable also supplies a smart allocation system. class drawable { public: virtual void draw(frame *) = 0; // So we get the right size to delete (ick) virtual ~drawable() { } }; typedef list objlist; class DisplayString : public string { // These are primarily used to keep track of the extended string // info. A drawable class is derived to display them. public: int j; // justification modifiers (should be just, // but int supports | and & double size; // Fontsize int relsz; // True if the fontsize is relative bool clip; // True if the string can only appear in the frame string *color; // color of the string DisplayString() : string(), j(none), size(0), relsz(0), clip(true), color(0) { } DisplayString(const char *s, int ju=0, double sz=0, int rsz=0, bool c=true, string *col=0) : string(s), j(ju), size(sz), relsz(rsz), clip(c), color(col) { } DisplayString(string s, int ju=0, double sz=0, int rsz=0, bool c=true, string *col=0) : string(s), j(ju), size(sz), relsz(rsz), clip(c), color(col) { } DisplayString(const DisplayString& ds) : string(ds), j(ds.j), size(ds.size), relsz(ds.relsz), clip(ds.clip), color(ds.color) { if ( color ) color = new string(*color); } DisplayString(double e, const DisplayString *fmt=0) : j(0), size(0), relsz(0), clip(true), color(0) { char *c = new char[64]; bool delf = false; if ( !fmt) { fmt = new DisplayString("%g"); delf = true; } snprintf(c,64,fmt->c_str(),e); // *this = c; assign(c); delete[] c; if ( delf ) delete fmt; else { j = fmt->j; size = fmt->size; relsz = fmt->relsz; clip = fmt->clip; if ( fmt->color ) color = new string(*fmt->color); else color = 0; } } ~DisplayString() { delete color; } }; // A grap coordinate system class coord { public: coord() : xmin(0), xmax(0),ymin(0), ymax(0), logscale(none), xautoscale(1), yautoscale(1), name() { } coord(const string& s) : xmin(0), xmax(0),ymin(0), ymax(0), logscale(none), xautoscale(1), yautoscale(1), name(s) { } coord(axis ls) : xmin(0), xmax(0),ymin(0), ymax(0), logscale(ls), xautoscale(1), yautoscale(1), name() { } coord(axis ls, const string& s) : xmin(0), xmax(0),ymin(0), ymax(0), logscale(ls), xautoscale(1), yautoscale(1), name(s) { } coord(double xi, double xa, double yi, double ya, axis ls) : xmin(xi), xmax(xa),ymin(yi), ymax(ya),logscale(ls), xautoscale(0), yautoscale(0), name() { } coord(double xi, double xa, double yi, double ya, axis ls, const string& s) : xmin(xi), xmax(xa),ymin(yi), ymax(ya),logscale(ls), xautoscale(0), yautoscale(0), name(s) { } coord(const coord& c) : xmin(c.xmin), xmax(c.xmax), ymin(c.ymin), ymax(c.ymax), logscale(c.logscale), xautoscale(c.xautoscale), yautoscale(c.yautoscale), name(c.name) { } double xmin, xmax; // x range double ymin, ymax; // y range axis logscale; // The axes that are logarithmic int xautoscale; // True if the user has not given an explicit x range int yautoscale; // True if the user has not given an explicit y range string name; // Name of the coordinate system, if any void newpt(double x, double y) { newx(x); newy(y); } void newx(double); void newy(double); // Add a margin to the system (0.07 is 7%) handles log scales void addmargin(double); // Convert to [0,1] double map(double, axis); }; class tick { public: double where; // x or y value of the tick double size; // how large a tick mark to make sides side; // Which side of the graph the mark is on DisplayString *prt; // The string to print next to the mark shiftlist shift; // Shift information, to fine tune position of prt coord *c; // The coordinate scale that the tick is in tick() : where(0), size(0), side(top_side), prt(0), shift(), c(0) { } tick(const tick& t) : where(t.where), size(t.size), side(t.side), shift(), c(t.c) { shiftcpy sc(&shift); if ( t.prt ) prt = new DisplayString(*t.prt); else prt =0; for_each(t.shift.begin(), t.shift.end(), sc); } tick(double w, double s, sides sd, DisplayString *p, shiftlist *sh, coord *co) : where(w), size(s), side(sd), shift(), c(co) { shiftcpy sc(&shift); if ( p ) prt = new DisplayString(*p); else prt =0; if ( sh ) for_each(sh->begin(), sh->end(), sc); } ~tick() { shiftdesc *s; if ( prt) { delete prt; prt = 0; } while ( !shift.empty() ) { s = shift.front(); shift.pop_front(); delete s; } } // Important safety tip: Don't byte-copy string pointers. tick& operator=(const tick& t) { shiftcpy sc(&shift); where = t.where; size = t.size; side = t.side; shift = t.shift; c = t.c; if ( prt ) { delete prt; } if ( t.prt ) prt = new DisplayString(*t.prt); else prt = 0; for_each(t.shift.begin(), t.shift.end(), sc); return *this; } }; class grid { public: double where; // x or y value of the grid line linedesc desc; // style of the grid line sides side; // Side of the graph where line labels are printed DisplayString *prt; // The label for this line shiftlist shift; // Shift info for the label coord *c; // Coordinate system for this line grid() : where(0), desc(dotted,0,0), side(top_side), prt(0), shift(), c(0) { } grid(double w, linedesc *l, sides sd, DisplayString *p, shiftlist *sh, coord *co) : where(w), desc(l), side(sd), prt(0), shift(), c(co) { shiftcpy sc(&shift); if ( p ) prt = new DisplayString(*p); if ( sh ) for_each(sh->begin(), sh->end(), sc); } // To allow ticks and grids to share parse rules grid(const tick *t) : where(t->where), desc(dotted,0,0), side(t->side), prt(0), shift(), c(t->c) { shiftcpy sc(&shift); if ( t->prt ) prt = new DisplayString(*t->prt); for_each(t->shift.begin(), t->shift.end(), sc); } grid(const grid& g) : where(g.where), desc(g.desc), side(g.side), prt(0), shift(), c(g.c) { shiftcpy sc(&shift); if ( g.prt ) prt = new DisplayString(*g.prt); for_each(g.shift.begin(), g.shift.end(), sc); } ~grid() { shiftdesc *s; if ( prt ) { delete prt; prt = 0; } while ( !shift.empty() ) { s = shift.front(); shift.pop_front(); delete s; } } // Important safety tip: Don't byte-copy string pointers. grid& operator=(const grid& g) { shiftcpy sc(&shift); where = g.where; desc = g.desc; side = g.side; shift = g.shift; c = g.c; if ( prt ) delete prt; if ( g.prt ) prt = new DisplayString(*g.prt); else prt = 0; for_each(g.shift.begin(), g.shift.end(), sc); return *this; } }; class point { public: double x,y; // Point coordinates coord *c; // system the coordinates are in point() : x(0), y(0), c(0) {} point(double xx, double yy, coord* cc) : x(xx), y(yy), c(cc) { if ( c ) c->newpt(x, y); } point(const point *p) : x(p->x), y(p->y), c(p->c) { if ( c ) c->newpt(x, y); } point(const point& p) : x(p.x), y(p.x), c(p.c) { } point& operator=(point &p) { x = p.x; y = p.y; c = p.c; return *this; } }; class label { public: stringlist *strs; shiftlist *shifts; label(): strs(new stringlist), shifts(new shiftlist) { } label(stringlist *st, shiftlist *sl) : strs(st), shifts(sl) { } ~label() { if ( strs ) { stringlist::iterator s; for (s = strs->begin(); s != strs->end(); s++) delete (*s); strs->erase(strs->begin(), strs->end()); delete strs; strs=0; } if ( shifts ) { shiftlist::iterator s; for (s = shifts->begin(); s != shifts->end(); s++) delete (*s); shifts->erase(shifts->begin(), shifts->end()); delete shifts; shifts=0; } } }; typedef list