dpic-2023.06.01/0000755060175006010010000000000014435727177011755 5ustar DwightNonedpic-2023.06.01/autoconf/0000755060175006010010000000000014435727130013560 5ustar DwightNonedpic-2023.06.01/autoconf/configure.ac0000644060175006010010000000225114435727125016052 0ustar DwightNonednl Process this file with autoconf to produce a configure script. dnl i.e. autoconf configure.ac > ../configure dnl For most systems a configure script is hardly required. AC_INIT(dpic,2021.04.10) AC_CONFIG_AUX_DIR(autoconf/scripts) m4_include(m4/ax_check_compile_flag.m4) AC_LANG_C PACKAGE=dpic UCPACKAGE=DPIC VERSION=2023.06.01 AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(UCPACKAGE) AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(PROGRAM_NAME, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_ARG_ENABLE(safemode, [ --enable-safemode compile with sh and copy disabled], if test "$enable_safemode" = "yes"; then AC_SUBST(safe_mode,-dSAFE_MODE) fi ) CFLAGS=${CFLAGS:-"-O"} AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_CHECK_HEADERS([time.h math.h assert.h]) dnl -DRAND and -DNO_SNPRINTF are retained but no longer implemented dnl MinGW requires -liberty AC_CHECK_FUNC(random,, [AC_CHECK_LIB(iberty,random, AC_SUBST(iberty,-liberty),AC_SUBST(defrand,-DRAND))]) AC_CHECK_FUNC(snprintf,,[AC_SUBST(defno_snprintf,-DNO_SNPRINTF)]) test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' AC_SUBST(INSTALL_DATA) AC_OUTPUT(Makefile) dnl EOF dpic-2023.06.01/autoconf/m4/0000755060175006010010000000000013204062670014072 5ustar DwightNonedpic-2023.06.01/autoconf/m4/ax_check_compile_flag.m40000644060175006010010000000640313102312002020565 0ustar DwightNone# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 5 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS dpic-2023.06.01/autoconf/scripts/0000755060175006010010000000000012740735142015246 5ustar DwightNonedpic-2023.06.01/autoconf/scripts/install.sh0000644060175006010010000001272111751522500017244 0ustar DwightNone#! /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=: 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 dpic-2023.06.01/backend.c0000644060175006010010000003724014410360223013470 0ustar DwightNone#define EXTRN extern #include "dpic.h" #include "lxcst.h" extern boolean ismdistmax (double); extern boolean isdistmax (double); extern int ahlex (int); extern int ahnum (int); extern int Ceil (double); extern int envinx (double); extern int Floor (double); extern double datan (double, double); extern double linlen(double, double); extern double distance(postype, postype); extern double Max (double, double); extern double Min (double, double); extern double principal (double, double); extern double qenv (primitive *, int, double); extern double venv (primitive *, int); extern int lspec (int); extern postype affang (postype, postype); extern postype affine (double, double, postype, postype); extern void checkjust (nametype *, boolean *, boolean *, boolean *, boolean *); extern void controls (void); extern void ddash (void); extern void deletename (nametype **); extern void deletetree (primitive **); extern void ddot (void); extern void fatal (int); extern void popgwarc (postype, postype, postype, double, double); extern void pprop (postype, postype *, double, double, double); extern void wcoord (FILE **, double, double); extern void wfloat (FILE **, double); extern void initnesw (void); extern void markerror (int); extern void newstr (nametype **); extern void nesw (primitive *); extern void setangles(double *, double *, postype, double, double, double, double); extern void wrand (void); extern void wstring (FILE **, nametype *); #ifdef DDEBUG extern int ordp(void *); #endif extern primitive *(findenv (primitive *)); /* Test (bit 4) if this segment has no parent */ boolean firstsegment (primitive * pr) { if (pr == NULL) { return false; } else { return (((pr->spec >> 3) & 1) == 0); } } #ifdef DDEBUG void logpos(char *lbl, postype P) { fprintf(log_, "\n %s:(", lbl); wfloat(&log_, P.xpos); putc(',', log_); wfloat(&log_, P.ypos); putc(')', log_); } void logspec(int sp) { switch (sp & 7) { case 1: fprintf(log_, "solid"); break; case 2: fprintf(log_, "dotted"); break; case 3: fprintf(log_, "dashed"); break; case 4: fprintf(log_, "invis"); break; } } #endif /* Test shaded, filled, dashed, dotted, solid */ boolean drawn (primitive * node, int linesp, double fill) { boolean dr; if (((fill >= 0.0) && (fill <= 1.0)) || (linesp == Xdotted) || (linesp == Xdashed) || (linesp == Xsolid)) { dr = true; } else { dr = false; if ((node->ptype == Xarrow) || (node->ptype == Xline) || (node->ptype == Xspline)) { while (node != NULL) { if (node->shadedp != NULL) { dr = true; node = NULL; } else { node = node->son; } } } else { dr = (node->shadedp != NULL); } } #ifdef DDEBUG if (debuglevel > 0) { fprintf(log_, " drawn(%d,%d(", ordp(node), linesp); logspec(linesp - Xlinetype); fprintf(log_, "),"); wfloat(&log_, fill); fprintf(log_, ")=%s\n", dr ? " TRUE" : "FALSE"); } #endif return dr; } /* Shading parameters for linear objects */ void getlinshade (primitive *nod, primitive **tn, nametype **ss, nametype **so, double *fillval, boolean *hshade) { primitive *primp; *tn = nod; *ss = NULL; *so = NULL; *fillval = -1.0; while ((*tn) != NULL) { primp = *tn; if (primp->outlinep != NULL) { *so = primp->outlinep; } *tn = (*tn)->son; } *tn = nod; if (*hshade) { *hshade = false; } else { while (nod != NULL) { primp = nod; if (primp->shadedp != NULL) { *ss = primp->shadedp; } if ((primp->linefill_ >= 0.0) && (primp->linefill_ <= 1.0)) { *fillval = primp->linefill_; } *tn = nod; nod = nod->son; } } if (((*ss) != NULL) || ((*fillval) >= 0.0)) { *hshade = true; } } /* Count the number of spline segments */ int primdepth (primitive * ptmp) { int dep = 0; while (ptmp != NULL) { dep++; ptmp = ptmp->son; } return dep; } /* Linespec from tail of a multisegment line */ void getlinespec (primitive * nd, int *lsp, primitive ** lastnd) { primitive *tn = nd; if ((nd->ptype == Xarc) || (nd->ptype == Xarrow) || (nd->ptype == Xline) || (nd->ptype == Xspline)) { while (tn->son != NULL) { tn = tn->son; } } *lastnd = tn; *lsp = lspec (tn->spec); } /* Distance to P control point */ double ahoffset (double ht, double wid, double lti) { if (wid == 0.0) { return 0.0; } else { return (lti * sqrt ((ht * ht) + (wid * wid / 4)) / wid); } } /* Arrowhead control points */ void dahead (postype point, postype shaft, double ht, double wid, double ltu, postype * P, postype * L, postype * R, postype * Px, postype * Lx, postype * Rx, postype * C, double *x, double *y) { /* arrowhead ht and wid, user units */ /* line thickness in diagram units */ /* adj point, left, right pts, dir cosines */ double h, v, po, t; #ifdef DDEBUG if (debuglevel > 0) { fprintf(log_, " dahead input:\n"); fprintf(log_, " ht="); wfloat(&log_, ht); fprintf(log_, ";wid="); wfloat(&log_, wid); fprintf(log_, ";ltu="); wfloat(&log_, ltu); fprintf(log_, ";fsc="); wfloat(&log_, fsc); logpos("point", point); logpos("shaft", shaft); putc('\n', log_); } #endif *C = affang(shaft, point); /* shaft direction cosines */ po = Min(ahoffset(ht, wid, ltu), ht); *P = affine(po, 0.0, point, *C); /* point adjusted by line thickness */ h = ht - (ltu / 2); *x = h - po; if (ht == 0.0) { v = 0.0; } else { v = (wid / 2) * (*x) / ht; } *R = affine(h, v, point, *C); *L = affine(h, -v, point, *C); if ((*x) == 0.0) { t = 1.0; } else { t = ht / (*x); } Rx->xpos = point.xpos + ((R->xpos - P->xpos) * t); /* right corner */ Rx->ypos = point.ypos + ((R->ypos - P->ypos) * t); Lx->xpos = point.xpos + ((L->xpos - P->xpos) * t); /* left corner */ Lx->ypos = point.ypos + ((L->ypos - P->ypos) * t); Px->xpos = (point.xpos + Lx->xpos + Rx->xpos) / 3; /* type 3 center pt */ Px->ypos = (point.ypos + Lx->ypos + Rx->ypos) / 3; if (distance(*Px, point) < distance(*P, point)) { *Px = *P; } if (ht == 0.0) { *y = 0.0; } else { *y = ht - po + (ltu * wid / ht / 4); } #ifdef DDEBUG if (debuglevel > 0) { fprintf(log_, " dahead out: po="); wfloat(&log_, po); logpos("P", *P); logpos("L", *L); logpos("R", *R); logpos("C", *C); logpos("Px", *Px); logpos("Lx", *Lx); logpos("Rx", *Rx); fprintf(log_, "\n x="); wfloat(&log_, *x); fprintf(log_, " y="); wfloat(&log_, *y); putc('\n', log_); } #endif } /* Intersection of two circles */ postype Cintersect(postype C1, double r1, postype C2, double r2, double ccw) { postype X, R; double dx, dy, cls, cq, f; dx = C1.xpos - C2.xpos; dy = C1.ypos - C2.ypos; cls = (dx * dx) + (dy * dy); if (cls == 0) { R.xpos = C1.xpos; R.ypos = C1.ypos; } else { cq = (cls + (r1 * r1) - (r2 * r2)) / 2; f = cq / cls; X.xpos = ((1 - f) * C1.xpos) + (f * C2.xpos); X.ypos = ((1 - f) * C1.ypos) + (f * C2.ypos); f = sqrt(Max((cls * r1 * r1) - (cq * cq),0.0)) / cls; R.xpos = X.xpos + (dy * f * ccw); R.ypos = X.ypos - (dx * f * ccw); } return R; } postype ArcCtr(postype AA, postype P, postype CC, double ccw) { postype A, C, Q, Ax, Rt; double asq, rsq, br; A.xpos = AA.xpos - P.xpos; A.ypos = AA.ypos - P.ypos; C.xpos = CC.xpos - P.xpos; C.ypos = CC.ypos - P.ypos; asq = (A.xpos * A.xpos) + (A.ypos * A.ypos); rsq = (C.xpos * C.xpos) + (C.ypos * C.ypos); if ((asq == 0) || (rsq == 0)) { Rt = CC; } else { Q.ypos = ccw * ((A.xpos * C.xpos) + (A.ypos * C.ypos)) / sqrt(asq * rsq); Q.xpos = sqrt(1 - (Q.ypos * Q.ypos)); br = sqrt(Max(0.0, 1 - (asq / (rsq * 4)))); Ax.xpos = (AA.xpos + P.xpos) / 2; Ax.ypos = (AA.ypos + P.ypos) / 2; Rt = affine(br * C.xpos, br * C.ypos, Ax, Q); } return Rt; } void /* Parameters and positions for traced arc arrows*/ arcahead(postype C, postype Point, int atyp, double ht, double wid, double lth, double radius, double angle, postype *P, postype *Co, postype *Ci, postype *Px, postype *Cox, postype *Cix, postype *Ao, postype *Ai, double *ccw, double *lwi, boolean *startarrow) { double t, ha; postype Q, Ac; #ifdef DDEBUG if (debuglevel > 0) { fprintf(log_, " arcahead input:"); logpos("C", C); fprintf(log_, "\n atyp="); fprintf(log_, "%d", atyp); fprintf(log_, ";ht="); wfloat(&log_, ht); fprintf(log_, ";wid="); wfloat(&log_, wid); fprintf(log_, ";lth="); wfloat(&log_, lth); fprintf(log_, ";radius="); wfloat(&log_, radius); fprintf(log_, ";angle="); wfloat(&log_, angle); putc('(', log_); wfloat(&log_, angle * 180 / pi); fprintf(log_, ")\n"); } #endif if (radius * angle > 0) { *ccw = 1.0; } else { *ccw = -1.0; } *startarrow = (radius >= 0); radius = fabs(radius); ht = Min( 2*radius, fabs(ht)); if (atyp == 0) { wid = Min( radius,fabs(wid) ); } else { wid = fabs(wid); } *lwi = (fabs(lth) / 72) * scale; /* line thickness in diagram units */ wid = Max(wid, *lwi); /* head angle, Ao, Ai */ if (radius == 0) { ha = 0.0; } else { ha = ht / radius; } Q.xpos = cos(ha); Q.ypos = (*ccw) * sin(ha); Ac = affine(Point.xpos - C.xpos, Point.ypos - C.ypos, C, Q); *Ao = Ac; pprop(C, Ao, wid / (-2), radius + (wid / 2), radius); *Ai = Ac; pprop(C, Ai, wid / 2, radius - (wid / 2), radius); /* Co, Ci */ *Co = ArcCtr(*Ao, Point, C, *ccw); *Ci = ArcCtr(*Ai, Point, C, *ccw); /* Point adjusted for line thickness */ if (wid == 0) { *P = *Ao; } else if (radius == 0) { *P = C; } else { t = (Min(wid, *lwi) / wid) * ht / radius; Q.xpos = cos(t); Q.ypos = (*ccw) * sin(t); *P = affine(Point.xpos - C.xpos, Point.ypos - C.ypos, C, Q); } /* Type 0 intersection */ if (atyp == 0) { *Px = Cintersect(*Co, radius - (*lwi), *Ci, radius + (*lwi), *ccw); if (distance(*Px,Point) > distance(Ac,Point)) { *Px = Ac; } *Cox = *Px; *Cix = *Px; } /* Other center and corners */ else { if (radius == 0) { t = 0.0; } else { t = Min( pi/2, (ht/radius)*2/3 ); } Q.xpos = cos(t); Q.ypos = (*ccw) * sin(t); *Px = affine(Point.xpos - C.xpos, Point.ypos - C.ypos, C, Q); if (distance(*Px,Point) < distance(*P,Point)) { *Px = *P; } *Cox = ArcCtr(*Px, *Ao, *Co, -(*ccw)); *Cix = ArcCtr(*Px, *Ai, *Ci, -(*ccw)); } #ifdef DDEBUG if (debuglevel > 0) { fprintf(log_, "\n arcahead out:\n"); fprintf(log_, " lwi="); wfloat(&log_, *lwi); logpos("C", C); logpos("Point", Point); logpos("Ao", *Ao); logpos("Ai", *Ai); logpos("Ac", Ac); logpos("Co", *Co); logpos("Ci", *Ci); logpos("P", *P); logpos("Px", *Px); logpos("Cox", *Cox); logpos("Cix", *Cix); putc('\n', log_); } #endif } /* Arc start point */ postype arcstart (primitive * n) { postype X; X.xpos = n->aat.xpos + (n->aradius_ * cos (n->startangle_)); X.ypos = n->aat.ypos + (n->aradius_ * sin (n->startangle_)); return X; } /* Arc end point */ postype arcend (primitive * n) { postype X; X.xpos = n->aat.xpos + (n->aradius_ * cos (n->startangle_ + n->arcangle_)); X.ypos = n->aat.ypos + (n->aradius_ * sin (n->startangle_ + n->arcangle_)); return X; } /* Output \shortstack{line1\\ line2 ...} if more than one text line, otherwise line1*/ void texstacktext (primitive * np, nametype * tp) { nametype *tx; boolean A, B, L, R; double toff; if (tp == NULL) { return; } tx = tp->nextname; if (tx != NULL) { printf ("\\shortstack{"); } toff = (venv (np, Xtextoffset) / scale) * 72; do { checkjust (tp, &A, &B, &L, &R); if (L) { printf ("\\rlap{\\hbox to "); wfloat (&output, toff); printf ("bp{}"); } else if (R) { printf ("\\llap{"); } wstring (&output, tp); if (R) { printf ("\\hbox to "); wfloat (&output, toff); printf ("bp{}"); } if (L || R) { putchar ('}'); } tp = tp->nextname; if (tp != NULL) { printf ("\\\\%%\n"); } } while (tp != NULL); if (tx != NULL) { putchar ('}'); } } /* Output leftbrace x rightbrace */ void wbrace (double x) { putchar ('{'); wfloat (&output, x); putchar ('}'); } /* Output (x,y) */ void wpair (FILE ** iou, double x, double y) { putc ('(', *iou); wfloat (iou, x); putc (',', *iou); wfloat (iou, y); putc (')', *iou); } /* Output (x,y) with final scaling */ void wcoord (FILE ** iou, double x, double y) { putc ('(', *iou); wfloat (iou, x / fsc); putc (',', *iou); wfloat (iou, y / fsc); putc (')', *iou); } /* Output position as (x,y) with final scaling*/ void wpos (postype pos) { wcoord (&output, pos.xpos, pos.ypos); } /* Output P2 = (a*P1 + b*P2)/c (for arrows) */ void wprop (postype p1, postype p2, double a, double b, double c) { pprop (p1, &p2, a, b, c); /* Note: p2 is not var */ wpos (p2); } /* Angle of the line from C to V */ double posangle (postype V, postype C) { return (datan (V.ypos - C.ypos, V.xpos - C.xpos)); } /*--------------------------------------------------------------------*/ #include "ps.c" #include "pst.c" #include "pdf.c" #include "svg.c" #include "mfp.c" #include "mpo.c" #include "pgf.c" #include "tex.c" #include "xfig.c" /* Recursive output of the drawing-tree nodes*/ void treedraw (primitive * node) { while (node != NULL) { switch (drawmode) { case TeX: case tTeX: case Pict2e: texdraw (node); break; case PDF: pdfdraw (node); break; case PGF: pgfdraw (node); break; case PSTricks: pstdraw (node); break; case MFpic: mfpdraw (node); break; case PS: case PSfrag: psdraw (node); break; case MPost: mpodraw (node); break; case SVG: svgdraw (node); break; case xfig: xfigdraw (node); break; } if (node->son != NULL) { treedraw (node->son); } if (drawmode == PDF) { resetgs (node); } else if ((drawmode == xfig) && (node->ptype == Xblock) && (node->direction == (-1))) { printf ("-6\n"); } hasfill = false; shadestr = NULL; outlinestr = NULL; node = node->nextname; } } /* Set up scale parameters and draw the tree */ void drawtree (double n, double s, double e, double w, primitive * eb) { double fsctmp; hasfill = false; shadestr = NULL; outlinestr = NULL; switch (drawmode) { case SVG: fsctmp = fsc; fsc /= dpPPI; svgprelude (n, s, e, w, (venv (eb, Xlinethick) / 72) * scale); treedraw (eb); svgpostlude (); fsc = fsctmp; break; case PGF: pgfprelude (); treedraw (eb); pgfpostlude (); break; case PSTricks: pstprelude (n, s, e, w); treedraw (eb); pstpostlude (); break; case MFpic: mfpprelude (n, s, e, w); treedraw (eb); mfppostlude (); break; case PS: case PSfrag: fsctmp = fsc; fsc /= 72; psprelude (n, s, e, w, venv (eb, Xlinethick)); treedraw (eb); pspostlude (); fsc = fsctmp; break; case PDF: fsctmp = fsc; fsc /= 72; pdfprelude (n, s, e, w, venv (eb, Xlinethick)); treedraw (eb); pdfpostlude (); fsc = fsctmp; break; case MPost: fsctmp = fsc; fsc /= 72; mpoprelude (); treedraw (eb); mpopostlude (); fsc = fsctmp; break; case xfig: xfigprelude (); treedraw (eb); break; case TeX: case tTeX: case Pict2e: if (!isdistmax (s)) { texprelude (n, s, e, w); treedraw (eb); texpostlude (); } break; } } /* End. */ dpic-2023.06.01/CHANGES0000644060175006010010000000353214434664026012743 0ustar DwightNone 2023 06 01 Robust arrowheads and pgf text offsets. 2023 02 01 Distribution number change. 2023 01 12 Distribution fix and cleanup. 2022 12 01 More precise obtuse-angle arcs. 2022 02 02 Minor addition to the manual. 2021 11 01 Non-LaTeX error-handling cleanup. 2021 08 01 Line thickness recovery parameter enabled. 2021 05 15 Redundant code dating from pascal conversion removed. 2021 05 12 Robustness fixes. 2021 04 10 Improved robustness for fuzzed input. 2021 01 01 Added colored svg sprintf text and % appended to selected outputs. 2020 09 15 Shift operation bugfix. 2020 09 01 Improved error messaging; additional distribution examples. 2020 06 01 SVG text adjustments; GCC-10 conformance. 2020 03 01 Commas protected by brackets; zero-repetition "for" loop bugfix under bison. 2019 11 30 Fix of environment variable scope, arc attribute; improved error messages; generalized macro definition. 2019 08 30 Debug fixes. 2019 07 30 Corrected typos, copyright notices, version number, string treatment. 2019 07 20 Bugfix for buffer overflow with extreme arguments of wfloat(). 2019 06 20 This is a major clone of the previous distribution, which contained compilable C code together with the original pascal source. The pascal was translated to C code using p2c, which was included, and parsing was automated by a custom compiler-compiler which was also provided. The current package includes C source only with parsing automated using GNU bison. The original lexical analyser has been kept. To avoid introducing bugs, the C code has been changed only to accommodate bison; some p2c idiosyncrasies remain. The result is functionally identical to the previous version for correct input. A configure file (only needed for MinGW) added. dpic-2023.06.01/configure0000755060175006010010000042372614435727130013667 0ustar DwightNone#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for dpic 2021.04.10. # # # Copyright (C) 1992-1996, 1998-2012 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 if test -n "${ZSH_VERSION+set}" && (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 case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : 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 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 exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || 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_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. 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_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if 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'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do 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_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=`$as_echo "$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 || $as_echo 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_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_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # 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 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$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 || $as_echo 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" || { $as_echo "$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 } 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 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='dpic' PACKAGE_TARNAME='dpic' PACKAGE_VERSION='2021.04.10' PACKAGE_STRING='dpic 2021.04.10' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS defno_snprintf defrand iberty EGREP GREP CPP SET_MAKE INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC safe_mode UCPACKAGE VERSION PACKAGE 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' ac_subst_files='' ac_user_opts=' enable_option_checking enable_safemode ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # 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 # Accept the important Cygnus configure options, so we can diagnose typos. 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=`$as_echo "$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=`$as_echo "$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=`$as_echo "$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=`$as_echo "$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. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${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" ;; *) $as_echo "$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 || $as_echo 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 dpic 2021.04.10 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/dpic] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of dpic 2021.04.10:";; 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-safemode compile with sh and copy disabled Some influential environment variables: CC C compiler command CFLAGS 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 CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` 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 guested configure. 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 $as_echo "$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 dpic configure 2021.04.10 generated by GNU Autoconf 2.69 Copyright (C) 2012 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_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (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 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 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_c_try_run # ac_fn_c_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_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (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 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$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_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else 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. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #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 () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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 dpic $as_me 2021.04.10, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _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 test -z "$as_dir" && as_dir=. $as_echo "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=`$as_echo "$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=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; 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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$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 $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 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 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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_aux_dir= for ac_dir in autoconf/scripts "$srcdir"/autoconf/scripts; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf/scripts \"$srcdir\"/autoconf/scripts" "$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. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 5 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 PACKAGE=dpic UCPACKAGE=DPIC VERSION=2023.06.01 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define PROGRAM_NAME "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Check whether --enable-safemode was given. if test "${enable_safemode+set}" = set; then : enableval=$enable_safemode; if test "$enable_safemode" = "yes"; then safe_mode=-dSAFE_MODE fi fi CFLAGS=${CFLAGS:-"-O"} ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 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\"" $as_echo "$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 $as_echo "$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 () { ; 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # 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+set}" = set && 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 ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } 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 () { 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; 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\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : 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_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /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+set}" = set; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in time.h math.h assert.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random" if test "x$ac_cv_func_random" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for random in -liberty" >&5 $as_echo_n "checking for random in -liberty... " >&6; } if ${ac_cv_lib_iberty_random+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liberty $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char random (); int main () { return random (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iberty_random=yes else ac_cv_lib_iberty_random=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iberty_random" >&5 $as_echo "$ac_cv_lib_iberty_random" >&6; } if test "x$ac_cv_lib_iberty_random" = xyes; then : iberty=-liberty else defrand=-DRAND fi fi ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : else defno_snprintf=-DNO_SNPRINTF fi test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' 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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; 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+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} 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 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.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=`$as_echo "$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 : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} 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 if test -n "${ZSH_VERSION+set}" && (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 case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; 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 # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # 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 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$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_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_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 || $as_echo 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 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 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=`$as_echo "$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 || $as_echo 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 dpic $as_me 2021.04.10, which was generated by GNU Autoconf 2.69. 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 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _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 Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ dpic config.status 2021.04.10 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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' 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 ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -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 \$as_echo "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 $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _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 "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+set}" = set || CONFIG_FILES=$config_files 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" eval set X " :F $CONFIG_FILES " 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=`$as_echo "$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 '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$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 || $as_echo 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` 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 _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@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _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 $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"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' 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 ;; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi dpic-2023.06.01/Copyright.txt0000644060175006010010000010166214364251051014454 0ustar DwightNoneFiles: All except as noted below: Copyright: 2023, J. D. Aplevich License: BSD-2-clause Files: dpic-doc.pdf Copyright: 2023 J. D. Aplevich License: CC-BY-3.0 Files: doc/dpictools.pic Copyright: 2023 J. D. Aplevich License: LaTeX Project Public License v. 1.3c Files: dpic.tab.* Copyright: 1984, 1989-1990, 2000-2015, Free Software Foundation, Inc. License: GPL-3+ with bison exception Files: autoconf/scripts/install.sh Copyright: 1991, the Massachusetts Institute of Technology License: NTP Files: autoconf/m4/ax_check_compile_flag.m4 Copyright: 2008, Guido U. Draheim 2011, Maarten Bosmans License: GPL-3+ with AutoConf exception Installation-specific auxiliary files as applicable, including: Files: debian/* Copyright: 2019, Aniol Marti License: BSD-3-clause --------------------------------------------------------------------- License: BSD-2-clause 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 COPYRIGHT HOLDER "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 COPYRIGHT HOLDER 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. --------------------------------------------------------------------- License: CC-BY-3.0 Creative Commons Attribution 3.0 Unported . CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. . License . THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. . BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. . 1. Definitions . a. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. . b. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. . c. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. . d. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. . e. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. . f. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. . g. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. . h. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. . i. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. . 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. . 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: . a. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; . b. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; . c. to Distribute and Publicly Perform the Work including as incorporated in Collections; and, . d. to Distribute and Publicly Perform Adaptations. . e. For the avoidance of doubt: . i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; . ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, . iii. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. . The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. . 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: . a. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. . b. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. --------------------------------------------------------------------- The LaTeX Project Public License =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- LPPL Version 1.3c 2008-05-04 Copyright 1999 2002-2008 LaTeX3 Project Everyone is allowed to distribute verbatim copies of this license document, but modification of it is not allowed. PREAMBLE ======== The LaTeX Project Public License (LPPL) is the primary license under which the LaTeX kernel and the base LaTeX packages are distributed. You may use this license for any work of which you hold the copyright and which you wish to distribute. This license may be particularly suitable if your work is TeX-related (such as a LaTeX package), but it is written in such a way that you can use it even if your work is unrelated to TeX. The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', below, gives instructions, examples, and recommendations for authors who are considering distributing their works under this license. This license gives conditions under which a work may be distributed and modified, as well as conditions under which modified versions of that work may be distributed. We, the LaTeX3 Project, believe that the conditions below give you the freedom to make and distribute modified versions of your work that conform with whatever technical specifications you wish while maintaining the availability, integrity, and reliability of that work. If you do not see how to achieve your goal while meeting these conditions, then read the document `cfgguide.tex' and `modguide.tex' in the base LaTeX distribution for suggestions. DEFINITIONS =========== In this license document the following terms are used: `Work' Any work being distributed under this License. `Derived Work' Any work that under any applicable law is derived from the Work. `Modification' Any procedure that produces a Derived Work under any applicable law -- for example, the production of a file containing an original file associated with the Work or a significant portion of such a file, either verbatim or with modifications and/or translated into another language. `Modify' To apply any procedure that produces a Derived Work under any applicable law. `Distribution' Making copies of the Work available from one person to another, in whole or in part. Distribution includes (but is not limited to) making any electronic components of the Work accessible by file transfer protocols such as FTP or HTTP or by shared file systems such as Sun's Network File System (NFS). `Compiled Work' A version of the Work that has been processed into a form where it is directly usable on a computer system. This processing may include using installation facilities provided by the Work, transformations of the Work, copying of components of the Work, or other activities. Note that modification of any installation facilities provided by the Work constitutes modification of the Work. `Current Maintainer' A person or persons nominated as such within the Work. If there is no such explicit nomination then it is the `Copyright Holder' under any applicable law. `Base Interpreter' A program or process that is normally needed for running or interpreting a part or the whole of the Work. A Base Interpreter may depend on external components but these are not considered part of the Base Interpreter provided that each external component clearly identifies itself whenever it is used interactively. Unless explicitly specified when applying the license to the Work, the only applicable Base Interpreter is a `LaTeX-Format' or in the case of files belonging to the `LaTeX-format' a program implementing the `TeX language'. CONDITIONS ON DISTRIBUTION AND MODIFICATION =========================================== 1. Activities other than distribution and/or modification of the Work are not covered by this license; they are outside its scope. In particular, the act of running the Work is not restricted and no requirements are made concerning any offers of support for the Work. 2. You may distribute a complete, unmodified copy of the Work as you received it. Distribution of only part of the Work is considered modification of the Work, and no right to distribute such a Derived Work may be assumed under the terms of this clause. 3. You may distribute a Compiled Work that has been generated from a complete, unmodified copy of the Work as distributed under Clause 2 above, as long as that Compiled Work is distributed in such a way that the recipients may install the Compiled Work on their system exactly as it would have been installed if they generated a Compiled Work directly from the Work. 4. If you are the Current Maintainer of the Work, you may, without restriction, modify the Work, thus creating a Derived Work. You may also distribute the Derived Work without restriction, including Compiled Works generated from the Derived Work. Derived Works distributed in this manner by the Current Maintainer are considered to be updated versions of the Work. 5. If you are not the Current Maintainer of the Work, you may modify your copy of the Work, thus creating a Derived Work based on the Work, and compile this Derived Work, thus creating a Compiled Work based on the Derived Work. 6. If you are not the Current Maintainer of the Work, you may distribute a Derived Work provided the following conditions are met for every component of the Work unless that component clearly states in the copyright notice that it is exempt from that condition. Only the Current Maintainer is allowed to add such statements of exemption to a component of the Work. a. If a component of this Derived Work can be a direct replacement for a component of the Work when that component is used with the Base Interpreter, then, wherever this component of the Work identifies itself to the user when used interactively with that Base Interpreter, the replacement component of this Derived Work clearly and unambiguously identifies itself as a modified version of this component to the user when used interactively with that Base Interpreter. b. Every component of the Derived Work contains prominent notices detailing the nature of the changes to that component, or a prominent reference to another file that is distributed as part of the Derived Work and that contains a complete and accurate log of the changes. c. No information in the Derived Work implies that any persons, including (but not limited to) the authors of the original version of the Work, provide any support, including (but not limited to) the reporting and handling of errors, to recipients of the Derived Work unless those persons have stated explicitly that they do provide such support for the Derived Work. d. You distribute at least one of the following with the Derived Work: 1. A complete, unmodified copy of the Work; if your distribution of a modified component is made by offering access to copy the modified component from a designated place, then offering equivalent access to copy the Work from the same or some similar place meets this condition, even though third parties are not compelled to copy the Work along with the modified component; 2. Information that is sufficient to obtain a complete, unmodified copy of the Work. 7. If you are not the Current Maintainer of the Work, you may distribute a Compiled Work generated from a Derived Work, as long as the Derived Work is distributed to all recipients of the Compiled Work, and as long as the conditions of Clause 6, above, are met with regard to the Derived Work. 8. The conditions above are not intended to prohibit, and hence do not apply to, the modification, by any method, of any component so that it becomes identical to an updated version of that component of the Work as it is distributed by the Current Maintainer under Clause 4, above. 9. Distribution of the Work or any Derived Work in an alternative format, where the Work or that Derived Work (in whole or in part) is then produced by applying some process to that format, does not relax or nullify any sections of this license as they pertain to the results of applying that process. 10. a. A Derived Work may be distributed under a different license provided that license itself honors the conditions listed in Clause 6 above, in regard to the Work, though it does not have to honor the rest of the conditions in this license. b. If a Derived Work is distributed under a different license, that Derived Work must provide sufficient documentation as part of itself to allow each recipient of that Derived Work to honor the restrictions in Clause 6 above, concerning changes from the Work. 11. This license places no restrictions on works that are unrelated to the Work, nor does this license place any restrictions on aggregating such works with the Work by any means. 12. Nothing in this license is intended to, or may be used to, prevent complete compliance by all parties with all applicable laws. NO WARRANTY =========== There is no warranty for the Work. Except when otherwise stated in writing, the Copyright Holder provides the Work `as is', without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the Work is with you. Should the Work prove defective, you assume the cost of all necessary servicing, repair, or correction. In no event unless required by applicable law or agreed to in writing will The Copyright Holder, or any author named in the components of the Work, or any other party who may distribute and/or modify the Work as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of any use of the Work or out of inability to use the Work (including, but not limited to, loss of data, data being rendered inaccurate, or losses sustained by anyone as a result of any failure of the Work to operate with any other programs), even if the Copyright Holder or said author or said other party has been advised of the possibility of such damages. MAINTENANCE OF THE WORK ======================= The Work has the status `author-maintained' if the Copyright Holder explicitly and prominently states near the primary copyright notice in the Work that the Work can only be maintained by the Copyright Holder or simply that it is `author-maintained'. The Work has the status `maintained' if there is a Current Maintainer who has indicated in the Work that they are willing to receive error reports for the Work (for example, by supplying a valid e-mail address). It is not required for the Current Maintainer to acknowledge or act upon these error reports. The Work changes from status `maintained' to `unmaintained' if there is no Current Maintainer, or the person stated to be Current Maintainer of the work cannot be reached through the indicated means of communication for a period of six months, and there are no other significant signs of active maintenance. You can become the Current Maintainer of the Work by agreement with any existing Current Maintainer to take over this role. If the Work is unmaintained, you can become the Current Maintainer of the Work through the following steps: 1. Make a reasonable attempt to trace the Current Maintainer (and the Copyright Holder, if the two differ) through the means of an Internet or similar search. 2. If this search is successful, then enquire whether the Work is still maintained. a. If it is being maintained, then ask the Current Maintainer to update their communication data within one month. b. If the search is unsuccessful or no action to resume active maintenance is taken by the Current Maintainer, then announce within the pertinent community your intention to take over maintenance. (If the Work is a LaTeX work, this could be done, for example, by posting to comp.text.tex.) 3a. If the Current Maintainer is reachable and agrees to pass maintenance of the Work to you, then this takes effect immediately upon announcement. b. If the Current Maintainer is not reachable and the Copyright Holder agrees that maintenance of the Work be passed to you, then this takes effect immediately upon announcement. 4. If you make an `intention announcement' as described in 2b. above and after three months your intention is challenged neither by the Current Maintainer nor by the Copyright Holder nor by other people, then you may arrange for the Work to be changed so as to name you as the (new) Current Maintainer. 5. If the previously unreachable Current Maintainer becomes reachable once more within three months of a change completed under the terms of 3b) or 4), then that Current Maintainer must become or remain the Current Maintainer upon request provided they then update their communication data within one month. A change in the Current Maintainer does not, of itself, alter the fact that the Work is distributed under the LPPL license. If you become the Current Maintainer of the Work, you should immediately provide, within the Work, a prominent and unambiguous statement of your status as Current Maintainer. You should also announce your new status to the same pertinent community as in 2b) above. WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE ====================================================== This section contains important instructions, examples, and recommendations for authors who are considering distributing their works under this license. These authors are addressed as `you' in this section. Choosing This License or Another License ---------------------------------------- If for any part of your work you want or need to use *distribution* conditions that differ significantly from those in this license, then do not refer to this license anywhere in your work but, instead, distribute your work under a different license. You may use the text of this license as a model for your own license, but your license should not refer to the LPPL or otherwise give the impression that your work is distributed under the LPPL. The document `modguide.tex' in the base LaTeX distribution explains the motivation behind the conditions of this license. It explains, for example, why distributing LaTeX under the GNU General Public License (GPL) was considered inappropriate. Even if your work is unrelated to LaTeX, the discussion in `modguide.tex' may still be relevant, and authors intending to distribute their works under any license are encouraged to read it. A Recommendation on Modification Without Distribution ----------------------------------------------------- It is wise never to modify a component of the Work, even for your own personal use, without also meeting the above conditions for distributing the modified component. While you might intend that such modifications will never be distributed, often this will happen by accident -- you may forget that you have modified that component; or it may not occur to you when allowing others to access the modified version that you are thus distributing it and violating the conditions of this license in ways that could have legal implications and, worse, cause problems for the community. It is therefore usually in your best interest to keep your copy of the Work identical with the public one. Many works provide ways to control the behavior of that work without altering any of its licensed components. How to Use This License ----------------------- To use this license, place in each of the components of your work both an explicit copyright notice including your name and the year the work was authored and/or last substantially modified. Include also a statement that the distribution and/or modification of that component is constrained by the conditions in this license. Here is an example of such a notice and statement: %% pig.dtx %% Copyright 2005 M. Y. Name % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % % The Current Maintainer of this work is M. Y. Name. % % This work consists of the files pig.dtx and pig.ins % and the derived file pig.sty. Given such a notice and statement in a file, the conditions given in this license document would apply, with the `Work' referring to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' referring to any `LaTeX-Format', and both `Copyright Holder' and `Current Maintainer' referring to the person `M. Y. Name'. If you do not want the Maintenance section of LPPL to apply to your Work, change `maintained' above into `author-maintained'. However, we recommend that you use `maintained', as the Maintenance section was added in order to ensure that your Work remains useful to the community even when you can no longer maintain and support it yourself. Derived Works That Are Not Replacements --------------------------------------- Several clauses of the LPPL specify means to provide reliability and stability for the user community. They therefore concern themselves with the case that a Derived Work is intended to be used as a (compatible or incompatible) replacement of the original Work. If this is not the case (e.g., if a few lines of code are reused for a completely different task), then clauses 6b and 6d shall not apply. Important Recommendations ------------------------- Defining What Constitutes the Work The LPPL requires that distributions of the Work contain all the files of the Work. It is therefore important that you provide a way for the licensee to determine which files constitute the Work. This could, for example, be achieved by explicitly listing all the files of the Work near the copyright notice of each file or by using a line such as: % This work consists of all files listed in manifest.txt. in that place. In the absence of an unequivocal list it might be impossible for the licensee to determine what is considered by you to comprise the Work and, in such a case, the licensee would be entitled to make reasonable conjectures as to which files comprise the Work. --------------------------------------------------------------------- dpic-2023.06.01/doc/0000755060175006010010000000000014426227631012510 5ustar DwightNonedpic-2023.06.01/doc/arrow.pic0000644060175006010010000000052311517607670014342 0ustar DwightNone% arrow.pic .PS arrowhead = 0 arrowwid *= 1.5 arrowht *= 1.5 linethick *= 1.5 arrow right "\tt arrowhead = 0" rjust at last arrow.start arrowhead = 3 arrow right from last arrow.start+(0,-0.15) "\tt arrowhead = 3" rjust at last arrow.start arrowhead = 2 arrow right from last arrow.start+(0,-0.15) "default" rjust at last arrow.start .PE dpic-2023.06.01/doc/arrow.tex0000644060175006010010000000144014426227602014361 0ustar DwightNone% arrow.pic \begin{tikzpicture}[scale=2.54]% % dpic version 2023.06.01 option -g for TikZ and PGF 1.01 \ifx\dpiclw\undefined\newdimen\dpiclw\fi \global\def\dpicdraw{\draw[line width=\dpiclw]} \global\def\dpicstop{;} \dpiclw=0.8bp \dpiclw=1.2bp \dpicdraw (0.347917,0.029431) --(0.465641,0) --(0.347917,-0.029431) \dpicstop \dpicdraw (0,0) --(0.465641,0)\dpicstop \draw (0,0) node[left=-2bp]{\tt arrowhead = 0}; \filldraw[line width=0bp](0.4,-0.15) --(0.35,-0.1875) --(0.5,-0.15) --(0.35,-0.1125) --cycle\dpicstop \dpicdraw (0,-0.15) --(0.465641,-0.15)\dpicstop \draw (0,-0.15) node[left=-2bp]{\tt arrowhead = 3}; \filldraw (0.35,-0.3375) --(0.5,-0.3) --(0.35,-0.2625) --cycle\dpicstop \dpicdraw (0,-0.3) --(0.465641,-0.3)\dpicstop \draw (0,-0.3) node[left=-2bp]{default}; \end{tikzpicture}% dpic-2023.06.01/doc/circles.pic0000644060175006010010000000345511450702500014623 0ustar DwightNone% circles.m4 .PS define lozenge { arc from $1$2 to $2$1 with .c at $2 arc from $2$1 to $1$2 with .c at $1 } A: circle dotted diam 0.7 thick 0.4 fill 0.95 "A" thick 0.4 B: circle dotted diam 0.45 at A+(0.4,0.2) fill 0.95 "B" thick 0.4 # Code from Circuit_macros cintersect macro: # AB: ((((((B).x-(A).x)^2+((B).y-(A).y)^2)+\ # (A.rad)^2-(B.rad)^2)/2)/(((B).x-(A).x)^2+((B).y-(A).y)^2)\ # between A and B) +\ # ((sqrt(max(0,(((B).x-(A).x)^2+((B).y-(A).y)^2)*(A.rad)^2\ # -(((((B).x-(A).x)^2+((B).y-(A).y)^2)+\ # (A.rad)^2-(B.rad)^2)/2)^2))/(((B).x-(A).x)^2+\ # ((B).y-(A).y)^2))*(-((B).y-(A).y)),\ # (sqrt(max(0,(((B).x-(A).x)^2+((B).y-(A).y)^2)*(A.rad)^2-\ # (((((B).x-(A).x)^2+((B).y-(A).y)^2)+\ # (A.rad)^2-(B.rad)^2)/2)^2))/(((B).x-(A).x)^2+\ # ((B).y-(A).y)^2))*(((B).x-(A).x))) AB: (0.54428,0.291128) "AB" at AB +(0.05,0.06) above rjust # Code from Circuit_macros cintersect macro: # BA: ((((((A).x-(B).x)^2+((A).y-(B).y)^2)+\ # (B.rad)^2-(A.rad)^2)/2)/(((A).x-(B).x)^2+((A).y-(B).y)^2)\ # between B and A) +\ # ((sqrt(max(0,(((A).x-(B).x)^2+((A).y-(B).y)^2)*(B.rad)^2-\ # (((((A).x-(B).x)^2+((A).y-(B).y)^2)+(B.rad)^2-\ # (A.rad)^2)/2)^2))/(((A).x-(B).x)^2+((A).y-(B).y)^2))*(-((A).y-(B).y)),\ # (sqrt(max(0,(((A).x-(B).x)^2+((A).y-(B).y)^2)*(B.rad)^2-\ # (((((A).x-(B).x)^2+((A).y-(B).y)^2)+(B.rad)^2-\ # (A.rad)^2)/2)^2))/(((A).x-(B).x)^2+((A).y-(B).y)^2))*(((A).x-(B).x))) BA: (0.69947,-0.019253) "BA" at BA below ljust "\tt shade(0.5,lozenge(A,B))" at A.s + (0.7,0) below linethick = 0.8 command "\global\let\dpicshdraw=\dpicdraw\global\def\dpicdraw{}" command "\global\def\dpicstop{--}" command sprintf("\dpicshdraw[fill=white!%g!black]",(0.5)*100) lozenge(A,B) command "cycle; \global\let\dpicdraw=\dpicshdraw\global\def\dpicstop{;}" #ozenge(A,B) .PE dpic-2023.06.01/doc/circles.tex0000644060175006010010000000221014426227602014647 0ustar DwightNone% circles.m4 \begin{tikzpicture}[scale=2.54]% % dpic version 2023.06.01 option -g for TikZ and PGF 1.01 \ifx\dpiclw\undefined\newdimen\dpiclw\fi \global\def\dpicdraw{\draw[line width=\dpiclw]} \global\def\dpicstop{;} \dpiclw=0.8bp \dpicdraw[fill=white!95!black,line width=0.4bp,dotted](0.35,0) circle (0.137795in)\dpicstop \draw (0.35,0) node{A}; \dpicdraw[fill=white!95!black,line width=0.4bp,dotted](0.75,0.2) circle (0.088583in)\dpicstop \draw (0.75,0.2) node{B}; \draw (0.59428,0.351128) node[above left=-2bp]{AB}; \draw (0.69947,-0.019253) node[below right=-2bp]{BA}; \draw (1.05,-0.35) node[below=-2bp]{\tt shade(0.5,lozenge(A,B))}; \dpiclw=0.8bp \global\let\dpicshdraw=\dpicdraw\global\def\dpicdraw{} \global\def\dpicstop{--} \dpicshdraw[fill=white!50!black] \dpicdraw (0.54428,0.291128) ..controls (0.517089,0.229745) and (0.518729,0.159426) ..(0.548753,0.099377) ..controls (0.578778,0.039328) and (0.634049,-0.004176) ..(0.69947,-0.019253)\dpicstop \dpicdraw (0.69947,-0.019253) ..controls (0.706281,0.104374) and (0.647268,0.2224) ..(0.54428,0.291128)\dpicstop cycle; \global\let\dpicdraw=\dpicshdraw\global\def\dpicstop{;} \end{tikzpicture}% dpic-2023.06.01/doc/dpic-doc.bib0000644060175006010010000000671414357355414014664 0ustar DwightNone @misc{Aplevich09, author={Aplevich, J. D.}, title={M4 Macros for Electric Circuit Diagrams in LaTeX Documents}, note={Available with the CTAN Circuit\_macros distribution: \url{http://www.ctan.org/tex-archive/graphics/circuit_macros/doc/Circuit_macros.pdf}}, year={2015}} @book{Bentley88, author={Bentley, J.}, title={More Programming Pearls}, address={Reading, Massachusetts}, publisher={Addison-Wesley}, year={1988}} @misc{Bentley2010, author={Bentley, J. and Yepez, A.}, title={Little Languages}, publisher={Mississippi State University}, note={\url{www.cse.msstate.edu/~niu/courses/CSE8990/slides/Alejandra-0210.pdf}}, year={2010}} @misc{Clark99, author={Clark, A. R.}, title={Using Circuit Macros}, note={Courtesy of Alan Robert Clark at \url{http://ytdp.ee.wits.ac.za/cct.html}}, year={1999}} @article{Girou94, author={Girou, D.}, title={Pr\'esentation de {PST}ricks}, journal={Cahiers {GUT}enberg}, volume={16}, note={% \url{http://www.gutenberg.eu.org/pub/GUTenberg/publicationsPDF/16-girou.pdf}}, year={1994}} @book{Goossens97, author={Goossens, M. and Rahtz, S. and Mittelbach, F.}, title={The \LaTeX Graphics Companion}, address={Reading, Massachusetts}, publisher={Addison-Wesley}, year={1997}} @misc{IEEEstd, author={IEEE}, title={Graphic Symbols for Electrical and Electronic Diagrams}, note={Std 315-1975, 315A-1986, reaffirmed 1993.}, institution={IEEE}, year={1975}} @misc{Johnstone92, author={Johnstone, A.}, title={Electronic symbols for \protect{\LaTeX}\ picture mode}, institution={Royal Holloway, University of London}, note={Email:{\tt adrean@cs.rhbnc.ac.uk}}, year={1992}} @techreport{KRm4, author={Kernighan, B. W. and Richie, D. M.}, title={The {M4} Macro Processor}, institution={Bell Laboratories}, note={\url{https://wolfram.schneider.org/bsd/7thEdManVol2/m4/m4.pdf}}, year={1977}} @techreport{KRpic, author={Kernighan, B. W. and Richie, D. M.}, title={{PIC}---{A} Graphics Language for Typesetting, User Manual}, institution={AT\&T Bell Laboratories}, series={Computing Science Technical Report}, number={116}, note={\url{http://doc.cat-v.org/unix/v10/10thEdMan/pic.pdf}}, year={1991}} @book{Landauer95, author={Landauer, Thomas K.}, title={The Trouble with Computers}, address={Cambridge}, publisher={MIT Press}, year={1995}} @misc{Raymond95, author={Raymond, E. S.}, title={Making Pictures With {GNU} {PIC}}, note={In {GNU} groff source distribution; also \url{http://www.kohala.com/start/troff/gpic.raymond.ps}}, ear={1995}} @book{Sedra97, author={Sedra, A. S. and Smith, K. C.}, title={Microelectronic Circuits}, address={Oxford}, publisher={Oxford University Press}, year={1997}} @misc{Seindal94, author={Seindal {\sl et al}, R.}, title={{GNU} m4}, note={\url{http://www.gnu.org/software/m4/manual/m4.html}}, institution={GNU}, year={1994}} @misc{Verwer92, author={Verwer, N.}, title={Readme for {L}oggates}, institution={Utrecht, Dept. of Computer Science}, note={Email:{\tt nico@cs.ruu.nl}}, year={1992}} @techreport{dvips, author={Rokicki, T.}, title={{DVIPS:} {A} {\TeX\ } Driver}, institution={Stanford}, year={1994}} @misc{gpic, author={The Free Software Foundation}, title={Gpic man page}, year={1992}} @misc{metapost, author={Hobby, J. D.}, title={A User's Manual for {M}eta{P}ost}, institution={Bell Laboratories}, year={1990}} @misc{mfpic, author={Leathrum, T. and Tobin, G.}, title={Pictures in {\TeX\ }with Metafont}, note={Mfpic manual}, year={1996}} @misc{pstricks, author={Van Zandt, T.}, title={{PST}ricks User's Guide}, institution={Princeton}, year={1993}} dpic-2023.06.01/doc/dpic-doc.tex0000644060175006010010000030213314425754660014724 0ustar DwightNone% dpic-doc.tex \documentclass[11pt]{article} \usepackage{verbatim,url} \usepackage{amssymb} \usepackage{graphicx} \usepackage{multicol} \usepackage{xspace} \usepackage{wrapfig} \usepackage{troffman} \usepackage{tikz} \usepackage{boxdims} % Fix the table of contents: \usepackage{tocloft} % For links \usepackage{bookmark} \usepackage{pdfcomment} % Fonts \usepackage[T1]{fontenc} \usepackage{lmodern} % Adjust the page size \addtolength{\textwidth}{3cm} \addtolength{\hoffset}{-1.5cm} \addtolength{\voffset}{-1.5cm} \addtolength{\headsep}{-0.5cm} \addtolength{\textheight}{4cm} \setcounter{topnumber}{3} % Minimum hyphenation length \lefthyphenmin=3 \righthyphenmin=3 % Left-justified captions \makeatletter \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \sbox\@tempboxa{#1: #2}% \ifdim \wd\@tempboxa >\hsize #1: #2\par \else \global \@minipagefalse \hb@xt@\hsize{\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip} %\def\@date{February 01, 2015} \makeatother % Customizations \newcommand{\bq}{} \newcommand{\pic}{{\bq pic}\xspace} \newcommand{\dvips}{{\bq dvips}\xspace} \newcommand{\Pic}{{\bq Pic}\xspace} \newcommand{\gpic}{{\bq gpic}\xspace} \newcommand{\Gpic}{{\bq Gpic}\xspace} \newcommand{\Dpic}{{\bq Dpic}\xspace} \newcommand{\tpic}{{\bq tpic}\xspace} %\renewcommand{\LaTeX}{{LaTeX}\xspace} \newcommand{\mfpic}{{\bq mfpic}\xspace} \newcommand{\groff}{{\bq groff}\xspace} \newcommand{\xfig}{{\bq xfig}\xspace} \newcommand{\PSTricks}{{\bq PSTricks}\xspace} \newcommand{\MetaPost}{{\bq MetaPost}\xspace} \newcommand{\Postscript}{{\bq Postscript}\xspace} \newcommand{\dpic}{{\bq dpic}\xspace} \newcommand{\Mfour}{{\bq m4}\xspace} \newcommand{\TPGF}{{\bq Ti{\it k}z~PGF}\xspace} % \setlength{\parindent}{0pt} \addtolength{\parskip}{1ex} \newcommand{\ntt}[1]{\\\hbox{}\quad{\tt #1}} \newcommand{\VL}{\hbox{$|$}} \newcommand{\tRA}{{\tt\char62}} \newcommand{\tBS}{{\tt\char92}} \newcommand{\tLB}{{\tt\char123}} \newcommand{\tRB}{{\tt\char125}} % \newcommand{\SR}[1]{\hyperref[#1]{Section~\ref*{#1}}} \newcommand{\PR}[1]{\hyperref[#1]{page~\pageref*{#1}}} \newcommand{\FR}[1]{\hyperref[#1]{Figure~\ref*{#1}}} % \hypersetup{ pdflang=English, unicode=true, colorlinks=true, linkcolor=purple, citecolor=purple} \begin{document} %\title{Drawing with dpic} %\author{Dwight Aplevich% %\date{\the\day\ \monthname[\the\month]\ \the\year} %\footnote{Copyright \textcopyright\ \the\year\ J.\ D.\ Aplevich, %all rights reserved. This document version is made available %under the Creative Commons attribution licence version 3.0 %(\protect{\tt http://creativecommons.org/licenses/by/3.0/}); %you are free to copy %and distribute this document provided proper attribution is given by %identifying the author. %}} %\maketitle% % \begin{centering} {\LARGE Drawing with dpic}\\ {\large Dwight Aplevich% \footnote{Copyright \textcopyright\ \the\year\ J.\ D.\ Aplevich, all rights reserved. This document version is made available under the Creative Commons attribution licence version 3.0 (\protect{\tt http://creativecommons.org/licenses/by/3.0/}); you are free to copy and distribute this document provided proper attribution is given by identifying the author. }\\ %\the\day\ \monthname[\the\month]\ \the\year}\\ \input{VERSION.tex}}\\ \end{centering} % \pdfbookmark[section]{\contentsname}{toc} \begin{multicols}{2} \tableofcontents \end{multicols} \section{Introduction} This document is meant for persons using dpic to produce diagrams for \LaTeX\ documents or web files. You are assumed to have basic knowledge of the pic language as described for the original Documenter's Workbench (ATT) pic~\cite{KRpic} or the current GNU pic (gpic) processor~\cite{Raymond95} but, for reference, a dpic language summary is included here in Appendix~A (\SR{Appendix A:}) and the context-free dpic input grammar is given in Appendix~B (\SR{Appendix B:}). The pic ``little language'' is particularly suited for easily creating line diagrams such as electric circuits, and many persons use a set of macros called Circuit\_macros, which are processed using the m4 macro processor and \dpic. The pic language itself allows macro definitions, and both pic and m4 macros will be described. Many other software tools can produce line diagrams and the choice of tool is often subjective or a matter of prior familiarity. The advantages of \dpic\ are that its basic use is easy to learn and that arbitrary formatted diagram text can be included using \LaTeX. \Dpic\ will also produce SVG output for web files but the advantage of employing a word processor for text is not then directly available. A route to sophisticated text in SVG is to use \LaTeX\ to produce a pdf file, followed by a pdf-to-svg converter. \Dpic accepts gpic input for the most part but there are minor differences. The outputs of gpic and dpic are quite different but both can serve as preprocessors that create diagrams for inclusion in \LaTeX\ documents. \Dpic usage will be reviewed, some programming examples that illustrate dpic extensions of the pic language will be given, and then the differences among pic translators will be itemized, particularly the differences between gpic and dpic. There had better be a disclaimer: the temptation to change the pic language has been resisted most of the time so that valid diagrams can be processed with minimal changes using the original Documenter's Workbench (ATT) pic, with gpic, or dpic. There are exceptions: embedded word-processor commands principally, but also minor differences in defaults for valid pic input, a few gpic constructs that dpic does not implement directly, and a few dpic extensions that gpic does not implement. For details, see \SR{Diffs:}. \section{Dpic usage}\label{Usage:} In the following, items in square brackets [~] are optional and items separated by a vertical line~\VL~are alternatives. To produce .tex output (for \LaTeX, \PSTricks, TikZ-PGF, \mfpic processing): \ntt{dpic {\rm[}{\sl options}{\rm]} {\sl file}.pic \tRA\ {\sl file}.tex}\\ or \ntt{cat {\sl file}.pic | dpic {\rm[}{\sl options}{\rm]} \tRA\ {\sl file}.tex} To produce other formats: \ntt{dpic {\rm[}-d{\VL}e{\VL}f{\VL}g{\VL}h{\VL}m% {\VL}p{\VL}r{\VL}s{\VL}t{\VL}v{\VL}x{\rm]} {\rm[}-z{\rm]} {\sl file}.pic \tRA\ {\sl file}{\rm[}.tex{\VL}eps{\VL}pdf{\VL}mp{\VL}fig{\VL}svg{\rm]}} \pagebreak \subsection{Options} \Dpic accepts the following options: \begin{tabbing} \quad\=\hbox{(none)\ }\= \kill \> (none) \> Latex picture-environment output (very limited font-based drawing commands)\\ \> {\tt -d} \> PDF output \\ \> {\tt -e} \> pict2e output \\ \> {\tt -f} \> Postscript output with psfrag strings \\ \> {\tt -g} \> TikZ-PGF output \\ \> {\tt -h} \> write out these options and quit \\ \> {\tt -m} \> mfpic output \\ \> {\tt -p} \> PSTricks output \\ \> {\tt -r} \> raw Postscript output \\ \> {\tt -s} \> MetaPost output \\ \> {\tt -t} \> eepicemu output \\ \> {\tt -v} \> SVG output \\ \> {\tt -x} \> xfig 3.2 output \\ \> {\tt -z} \> safe mode (disabled {\tt sh}, {\tt copy}, and print to file) \end{tabbing} The {\tt -p} option produces output for postprocessing by the \LaTeX\ package \PSTricks. Similarly, the {\tt -g} option produces output for the TikZ-PGF packages and makes pdf production via pdflatex a one-step process. Mfpic and \MetaPost output are provided for compatibility. The {\tt -r} option produces \Postscript\ {\tt .eps} files, in which font changes or typesetting must be done explicitly. % Output in this form can be imported into CorelDraw and Adobe Illustrator. The {\tt -f} option writes \Postscript strings in psfrag format for tex or latex typesetting. The {\tt -d} option produces PDF files. This format is most useful for diagrams containing graphics only, since there is no simple way to change or manipulate fonts for labels. The Courier fixed-width font is employed by default. To produce PDF files containing significant text content, use an option such as TikZ with pdflatex. The {\tt -v} option produces SVG for inserting figures into web documents or for further processing by the Inkscape graphics editor, for which SVG is the native format. When the SVG output is used directly in a web document, then any required text formatting generally must be included explicitly. One other possibility for SVG output is that an SVG library of elements can be drawn with dpic, and Inkscape used to place and connect copies of the elements. Then Inkscape can export the graphics as eps for processing by \LaTeX\ or as pdf for processing by pdflatex. Inkscape will also export a tex file from which labels can be formatted and overlaid on the imported eps or pdf. A third possibility is to produce the graphic without text and then overlay the text elements. The {\tt -z} option disables the commands that access external files. These commands can be permanently disabled by the use of a compile-time option. In all cases, arbitrary postprocessor commands (that is, arbitrary \PSTricks, SVG, \Postscript, or other code) can be inserted into the dpic output directly from the source. This possibility adds considerable power for manipulating diagram elements. % at the expense of integrating them into normal dpic output. The use of output formats meant to be processed by \LaTeX\ is quite different from the other formats. If a word processor is not part of the process, the selection and formatting of diagram text requires the insertion of postprocessor commands into the output. Dpic knows nothing of text formatting except for SVG output, for which basic sizing and placement are provided. The file Examples.txt contains a minimal example of each of these options except {\tt -z}. Consult the appropriate manual for processing \mfpic, \PSTricks, \MetaPost, pgf, or psfrag output. Invoking dpic without options produces basic \LaTeX\ drawing commands by default. \LaTeX\ line slopes, for example, are very limited and you must ensure that lines and arrows are drawn only at acceptable slopes. \Dpic sets the maximum slope integer to be 6 for \LaTeX, 453 for eepic, and 1000 for pict2e. To see the effect of the slope limitations, process the following: \begin{verbatim} .PS dtor = atan2(0,-1)/180 for d = 0 to 360 by 2 do { line from (0,0) to (cos(d*dtor),sin(d*dtor)) } line from (-1.2,0) to (1.2,0) line from (0,-1.2) to (0,1.2) .PE \end{verbatim} \subsection{Error messages} %\vspace*{-\baselineskip} The following is an example of an error message: \begin{verbatim} *** dpic ERROR: in macro "A", file "B.pic" line 16: x = y Variable not found Search failure for "y" \end{verbatim} Dpic displays the input file name with the number of the line to which scanning has progressed. The name of the current macro is also given if one is being executed. Most often, scanning stops on or near the offending line, which is displayed up to where reading ceased. However, the source of the problem might be a considerable distance from the indicated line number if the error is in a for loop or a macro. In the above example, line 16 of file B.pic happens to be \ntt{A(5)}\\ which invokes macro {\tt A,} so one has to find the definition of {\tt A} and look for the line \ntt{x = y}\\ within it. Syntax error messages show the offending line and state the lexical object that was found at or immediately before the error, together with expected (permissible) objects. Other errors are signalled according to the circumstances. %\enlargethispage{\baselineskip} \section{Dpic programming} %\vspace*{-\baselineskip} Pic is a simple language with a good ratio of power to complexity, so surprisingly sophisticated diagrams can be produced in several areas of application. Arbitrary postprocessor commands can be included in the output and several of the postprocessors are powerful drawing languages in their own right, so it can be argued that dpic has all the power of these languages. However, if you find yourself writing extensive postprocessor code then you might ask why you are not programming exclusively in that language. Similarly, pic floating-point operations and macro facilities enable complex numerical computations; the price is the inefficiency of number-crunching in an interpreted language. However, it can be convenient to calculate plotted values in the same source as graphing them and, although pic was developed for simplicity, its implementations are Turing-complete so arbitrarily complex computation is possible in principle. The pic language is very suitable for line diagrams with basic color. Elaborate fills and cropping are the domain of the postprocessors, but can be included easily with the use of macros. The following sections are intended to help you become familiar with dpic language syntax, which is simple but somewhat unusual. Some of these details are exclusive to dpic and are not described in the GNU manual but are discussed in \SR{Diffs:} of this document. %\iffalse \subsection{Character set} \Dpic\ input employs ordinary ASCII characters. The characters {\tt LF (\textbackslash{}n)} and {\tt CR (\textbackslash{}r)} have identical effect, and {\tt ETX (\textbackslash{}003)} is reserved for internal use. Characters outside the range of 0 to 127 are allowed in strings but receive no special treatment. %\fi \subsection{Blocks} The basic planar objects in pic are {\tt box}, {\tt circle}, and {\tt ellipse}, the placing of which is done according to the current drawing direction or by explicit placement such as \ntt{box at {\sl position}}\\ which places the object so that its center is at {\sl position}. Then the current drawing position {\tt Here} is set to be the north, south, east, or west compass point of the object depending on the current drawing direction. A block (also called a composite object) is a group of elements enclosed by square brackets, such as \ntt{Q: [ B: [A: arc]; circle ]}.\\ \subsubsection{Positioning blocks} A block is placed by default as if it were a box, after which the compass points ({\tt Q.n}, {\tt Q.sw},~$\ldots$ in the previous example) and exit point (current drawing position) {\tt Here} are automatically defined as for a box of the same size and position. A block can also be positioned by specifying the location of one of its defined points. A defined point is one of the following: \begin{enumerate} \item A compass corner {\tt .center}, {\tt .n}, {\tt .ne},~$\ldots$ of the block, e.g., \ntt{ Q: [ B: [A: arc]; circle ] with .ne at {\sl position}} \item A defined point of a labeled object or position within the block, preceded by a dot, e.g., \ntt{ Q: [ B: [A: arc]; circle ] with .B.A.ne at {\sl position}} \item A defined point of an enumerated object in the block, preceded by a dot (but make sure there is a space after the dot if it is followed by a number), e.g., \ntt{ Q: [ B: [A: arc]; circle ] with .\ 1st circle at {\sl position}}\\ Even better, put braces around the ordinal value, which can now be any expression, e.g., \ntt{~$\ldots$ with .\tLB{}10-9\tRB{}th circle at~$\ldots$} \item A displacement {\tt (x,y)} from the lower left corner of the block, e.g., \ntt{ Q: [ B: [A: arc]; circle ] with (0.5,0.2) at {\sl position}} \end{enumerate} Reference to a defined point may correspond to drilling down through several block layers, as the second example above shows. \subsubsection{Defining scope}\label{Scope:} Variables defined within a block are accessible only within the block itself or its sub-blocks. Thus, the statement {\tt x = 5} creates the variable {\tt x} and assigns it a value. If the statement is {\tt x~:=~5} then {\tt x} must already have been defined either in the block or in a scope containing the block. Limiting the scope to a block avoids name conflicts but occasionaly results in subtle behavior. The code \ntt{x = 5} \ntt{[ x = x + 2; print x ]} \ntt{print x}\\ prints 7 on the first line and 5 on the second because the assignment within brackets creates variable {\tt x} with scope within the brackets. However, \Dpic allows a second line of the form \ntt{[ x += 2; print x ]}\\ which changes the previously defined variable {\tt x} and the value 7 is printed twice. Locations inside a block are accessible from outside as shown in the previous section, but the values of variables are not; thus, an error results from \ntt{Q: [ v = 5 ]; y = Q.v}\\ The {\tt :=} assignment operator in \ntt{v = 0; Q: [ v := 5 ]; y = v}\\ works around this problem, but this method requires the internal name {\tt v} to be known and defined in advance of the block. Variable values can be exported by the use of macro arguments as shown later in \SR{Macros:} or, if you must, by using the following trick: \ntt{Q: [ v = 5; w = 6} \ntt{\quad Origin:\ (0,0); Export:\ (v,w) ]} \ntt{v = Q.Export.x - Q.Origin.x} \ntt{w = Q.Export.y - Q.Origin.y}\\ This method works because all locations ({\tt Origin} and {\tt Export}) inside the block will be translated by the same amount no matter where the block is positioned. \subsection{Dpic macros}\label{Macros:} Macros can be used to turn the basic dpic language into a powerful tool for producing line drawings. A macro extends the language and serves to \begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip} \item specialize the pic language in order to draw components from an application area \item abbreviate long sequences of repetitive commands \item substitute particular values in commands by the use of macro arguments \item provide conditional text replacement depending on the value of macro arguments \item provide recursive looping \end{itemize} Macro definitions are not local to blocks so care must be taken to avoid conflicts with macro names. The pic language includes basic macro facilities, but the m4 macro processor \cite{KRm4,Seindal94} makes a good companion to the language, so both will be mentioned. General-purpose macro definitions can be stored in files external to the diagram source and read in automatically. In particular, the author has written a package called Circuit\_macros~\cite{Aplevich09} for drawing electric circuits and other diagrams using dpic and m4, from which examples will be taken. A dpic macro is defined by the statement \ntt{define {\sl name} \tLB\ {\sl contents} \tRB}\\ where {\sl name} may begin with a lowercase or uppercase letter. The form \ntt{define {\sl name} X {\sl contents} X}\\ is also allowed, where {\tt X} is any character except \tLB. Then any separate appearance of {\sl name} in the following lines is replaced by the {\sl contents} characters, including newlines. If the name is given arguments of the form \ntt{{\sl name}({\sl x, y, z,~$\ldots$})}\\ then, in the macro body, {\tt\$}$n$ expands to the $n$th argument, which may be nul. %, if at least one argument has been defined and $n$ is a positive integer. % Otherwise {\tt\$}$n$ is not evaluated. The line \ntt{undefine {\sl name}}\\ deletes the macro definition. \pagebreak \Dpic skips white space immediately preceding macro arguments so that, for example, \ntt{{\sl name}( x, } \ntt{ y, z )}\\ is equivalent to \ntt{{\sl name}(x,y,z )} %\enlargethispage{\baselineskip} In a macro invocation, the arguments are separated by commas. An argument may contain commas if they are between {\tt (~)} parentheses, {\tt [~]} brackets, or in strings. A double quote character within a string must be preceded by a backslash. Thus, for example, the macro invocation \ntt{{\sl name}(ABc"{\textbackslash}"t,"(,DE,F))}\\ has one argument. In a dpic macro, the value of {\tt\$+} is the number of arguments given to the macro on invocation. Thus if {\sl x} is a macro name, the values of {\tt\$+} when the macro is invoked as {\sl x}, {\sl x}{\tt()}, {\sl x}{\tt(8)}, {\sl x}{\tt(8,9)}, and {\sl x}{\tt(,{},)} are respectively 0, 1, 1, 2, and 3. To check whether an argument is null, put it in a string; for example, \ntt{if "\$3" == "" then \{ $\ldots$ \}} Values internal to a scope can be passed back through macro arguments with the {\tt :=} operator; thus, executing the following \ntt{define m \{[ v = 5; \$1 := v ]\}; y = 0; m(y)}\\ gives {\tt y} the internal value of {\tt v}. Notice that {\tt y} must be defined prior to macro expansion. The use of macros will be illustrated in the following examples, for which source is included with this distribution and in the Circuit\_macros distribution~\cite{Aplevich09}. \subsubsection{Finding roots} A root finder is a powerful tool for determining where lines or curves intersect in diagrams, and can be implemented using a macro. Consider the trivial example in which we wish to find the root of $x^2-1$ between $0$ and $2$. First, define a macro called {\tt bisect} by reading in a library file containing definitions using a command such as \ntt{copy "{\sl filename}"}\\ or by writing a definition such as given below, which employs the method of bisection, a suitably robust (but not particularly fast) algorithm. Define the two-argument macro corresponding to the function of which we want to calculate the root: \ntt{define parabola \tLB\ \$2 = (\$1)\char94{}2 - 1 \tRB}\\ In general, many statements might be required to calculate the function, but the essential statement is to assign the function value to the name given by the second argument. Then call the {\tt bisect} macro using a command such as \ntt{bisect( parabola, 0, 2, 1e-8, x )}\\ where the second and third arguments define the search interval, the fourth argument specifies the solution precision, and the fifth argument is the name of the variable to be set to the root. A basic version of {\tt bisect} is given by \pagebreak \begin{verbatim} define bisect { x_m = $2; x_M = $3 x_c = (x_m+x_M)/2 if (abs(x_m-x_M) <= $4) then { $5 = x_c } else { $1(x_m,f_m) $1(x_c,f_c) if (sign(f_c)==sign(f_m)) then { bisect($1,x_c,x_M,$4,$5) } \ else { bisect($1,x_m,x_c,$4,$5) } } } \end{verbatim} \iffalse %\begin{wrapfigure}[9]{r}{0.4\textwidth}% \begin{wrapfigure}[4]{r}{0.4\textwidth}% % \vspace*{-4\baselineskip}% \vspace*{-12\baselineskip}% \hspace*{2em}% \parbox{0.4\textwidth}{\input{Spiral.tex}}% \end{wrapfigure}% \fi This macro repeatedly calls {\tt parabola} and then itself, halving the search interval until it is smaller than the prescribed precision. The Circuit\_macros library version operates essentially as above but avoids name clashes by appending the value of the first argument to the internal names. \begin{wrapfigure}[10]{r}{0.4\textwidth}% \vspace*{-3\baselineskip}% \hspace*{2em}% \parbox{0.4\textwidth}{\input{Spiral.tex}}% \end{wrapfigure}% A somewhat more sophisticated use of a root finder is shown at the right. Drawing the spiral on the surface of the sphere requires knowing the points of transition of the curve from visible to hidden and back. A root finder provides a method that is both simple and adaptable to other shapes. The source file {\tt Spiral.m4} makes use of both m4 macros and pic macros. \subsubsection{Composing statements} \Dpic macro arguments can be expanded almost anywhere. Suppose that circles {\tt A} and {\tt B} have been defined, with intersections at positions {\tt AB} and {\tt BA} found using the macro {\tt cintersect} from Circuit\_macros, for example. Then the boundary of the region within both circles might be drawn using the macro shown, invoked as {\tt lozenge(A,B)}: \begin{verbatim} define lozenge { arc from $1$2 to $2$1 with .c at $2 arc from $2$1 to $1$2 with .c at $1 } \end{verbatim} \smash{\hspace*{4in}\input circles.tex}% \vspace*{-\baselineskip} \subsubsection{Branching}\label{Branching:} Pic has a basic if-statement of the form \ntt{if {\sl expression} then \tLB\ {\sl if-true} \tRB\ else \tLB\ {\sl if-false} \tRB}\\ but lacks a case statement. Multiple branches can be defined by nested {\tt if} statements but there is another way. The macro \ntt{define case \tLB\ exec sprintf("\$\%g",floor(\$1+0.5)+1); \tRB}\\ adds 1 to its rounded first argument to determine which alternative among the remaining arguments should be executed. The semicolon (or a newline) forces dpic to perform the {\tt exec} statement before leaving the macro. For example, \ntt{case(2,} \ntt{\quad print "A",} \ntt{\quad print "B")}\\ executes the second alternative (the third argument) and prints B. \subsubsection{Looping} The pic language includes a basic for-loop, such as the following: \ntt{for x = 1 to 10 by 2 do \{ print x \}}\\ but there is no explicit language element (except macro recursion) for executing a block of code an indefinite number of times. However, the {\tt for} variable can be reset within the executable code, as in the following example where the first macro argument is printed and doubled repeatedly until it becomes greater than the second argument: %\ntt{define series \{ x = \$1; for i=1 to 2 do \{} %\ntt{ if x \tRA\ \$2 then \{ i = 2 \} else \{ print x; x = x*2; i=1 \} \} \}} \ntt{define series \{ x = \$1; for done = 0 to 1 do \{ print x; x *= 2} \ntt{ done = (x > \$2) \} \} } If this trick seems like an abuse of language, it can be disguised somewhat by the definition of a C-like loop. For example, suppose we wish to write %\ntt{loop(\ x=1,\ x<10,\ x=x*2,} %\ntt{ \ loop(\ y=1,\ y<=4,\ y=y+1,} %\ntt{ \ \ print (x,y)\ )\ )} \ntt{loop(i=0, i<3, i+=1, {\sl drawing commands \ldots})} Then the following defines a suitable mechanism with a loop depth index to allow nesting: \ntt{ld\_\_ = 0} \ntt{define loop \{ ld\_\_+= 1; \$1} \ntt{\ for lx\_\_[ld\_\_]=0 to 1 do \{} \ntt{\ \ if \$2 then \{ lx\_\_[ld\_\_]=0; \$4; \$3 \} else \{lx\_\_[ld\_\_]=1\}\}} \ntt{\ ld\_\_-= 1;} \} However, {\tt loop()} is a macro, so references to arguments in the body will refer to {\tt loop()} arguments, which may not be desired. In that case, use a {\tt for} loop. \iffalse The following prototypical examples show how several types of loop structures can implement the previous example: \fi \iffalse \begin{verbatim} # repeat until define finished {($1>=3)} i = 0 for done=0 to 1 do { {\sl drawing commands \ldots} i +=1 done=finished(i) } # while define while {($1 < 3)} i = 0 for done=1 to while(i) do { {\sl drawing commands \ldots} i+=1 done=!while(i) } # while not i = 0 for done=1 to !finished(i) do { {\sl drawing commands \ldots} i+=1 done=finished(i) } \end{verbatim} \fi The following prototypical example shows how to implement the previous example using a {\it repeat-until} structure that executes the drawing commands 1 or more times: %\ntt{\char35\ repeat until} %\ntt{i = 0} %\ntt{define finished \{(\$1 >= 3)\}} \ntt{i = 0; define finished \{(\$1 >= 3)\}} \ntt{for done = 0 to 1 do \{} \ntt{\ {\sl drawing commands \ldots}} \ntt{\ i += 1} \ntt{\ done = finished(i) \}} To execute the drawing code 0 or more times as in a {\it while} loop, change the {\tt for} line to \ntt{for done = 1 to !finished(i) do \{} \iffalse Similarly, a {\it while} structure that executes the drawing code 0 or more times for the previous example is: %\hbox{}\\ %\ntt{\char35\ while} \ntt{i = 0} \ntt{define while \{(\$1 < 3)\}} \ntt{for done = 1 to while(i) do \{} \ntt{\ {\sl drawing commands \ldots}} \ntt{\ i += 1} \ntt{\ done = !while(i) \}} \fi \iffalse \hbox{}\\ \ntt{\char35\ while not} \ntt{i = 0} \ntt{for done=1 to !finished(i) do \{} \ntt{\ {\sl drawing commands \ldots}} \ntt{\ i += 1} \ntt{\ done = finished(i) \}} \fi If such loops are nested, the loop variables and stopping criteria have to be defined so they do not clash. \subsubsection{Evaluating arguments} A macro argument is referenced as {\tt\$}$n$, where $n$ must be an integer and may not be an integer expression. Consequently, the following does not work in a \dpic macro: \ntt{for j=1 to \$+ do \tLB\ c[j] = \$j \tRB}\\ Instead, use the dpic statement \ntt{exec {\sl string}}\\ which executes the contents of {\sl string} as if it were the current input line. Since \ntt{sprintf("{\sl format}",{\sl expression},$\ldots$)}\\ behaves like a string, the following works: \ntt{for j=1 to \$+ do \tLB\ exec sprintf("c[j] = \$\%g",j); \tRB} \enlargethispage{\baselineskip} Macro arguments are passed verbatim, as for example, {\tt function(x,y+z)}, inside which {\tt \$1} is replaced by {\tt x} and {\tt \$2} is replaced by {\tt y+z}. To pass arguments by value, use {\tt exec sprintf ...}, for example, {\tt exec sprintf("function(\%g,\%g)",x,y+z)}. The recursive calls near the bottom of the sorting algorithm shown are another example: \begin{verbatim} # dpquicksort(a,lo,hi,ix) # Given array a[lo:hi] and index # array ix[lo:hi] = lo,lo+1,lo+2,...hi, sort # a[lo:hi] and do identical exchanges on ix define dpquicksort { [ if $3 > $2 then { pivot = $1[($2+($3))/2] loop(lo = $2; hi = $3, lo <= hi, loop(,$1[lo] < pivot, lo += 1) loop(,$1[hi] > pivot, hi -= 1) if lo < hi then { tmp = $1[lo]; $1[lo] := $1[hi]; $1[hi] := tmp tmp = $4[lo]; $4[lo] := $4[hi]; $4[hi] := tmp } if lo <= hi then { lo += 1; hi -= 1 } ) if hi > $2 then { exec sprintf("dpquicksort($1,%g,%g,$4)",$2,hi) } if lo < $3 then { exec sprintf("dpquicksort($1,%g,%g,$4)",lo,$3) } } ] } \end{verbatim} \subsubsection{Hiding variables} As mentioned in \SR{Scope:}, locations inside a block are accessible from outside, but the values of variables are not. Therefore, a block can be used to hide variables internal to a macro, as in the following example: \begin{verbatim} define rgbtohsv { $4=0; $5=0; $6=0; [ r = $1; g = $2; b = $3 maxc = max(max(r,g),b) minc = min(min(r,g),b) if maxc==minc then { $4 := 0 } \ else {if maxc == r then { $4 := pmod(60*((g-b)/(maxc-minc)),360) } \ else {if maxc == g then { $4 := 60*((b-r)/(maxc-minc)) + 120 } \ else { $4 := 60*((r-g)/(maxc-minc)) + 240 }}} if maxc == 0 then { $5 := 0 } else { $5 := 1 - (minc/maxc) } $6 := maxc ] } \end{verbatim} The three assignments in the first line of the example ensure that the variables exist when the {\tt :=} assignments are performed. This is not the full story, however. Macro arguments are called by name rather than by value; should the fourth argument, for example, be literally {\tt x[minc]}, then the interior variable {\tt minc} prevails. A block is only a partial solution to the problem of hiding variables, and care must be exercised in chosing the names of arguments. A more robust solution is to call by value using {\tt exec}; thus, {\tt exec sprintf("rgbtohsv(\%g, \%g, \%g, h, s, v)",% {\sl expr1},{\sl expr2},{\sl expr3})} In this case however, the last three arguments remain vulnerable to name clashes and should be named with care. When, as in the example, no drawing commands appear in a {\tt [ ]} block, then the block has zero size but has position {\tt Here} so the block can affect the diagram bounding box if {\tt Here} happens to be outside the intended bounding box of drawn elements. An alternative to this complication is to omit the {\tt [ ]} brackets and rename the local variables to avoid name clashes. For example, {\tt r} above could be {\tt r\_rgbtohsv} and so on for other variables. \subsubsection{Complex numbers} A complex number is an ordered pair of real numbers like a position, so it is natural to do complex algebra using macros such as the following example, which evaluates the product of two complex-number arguments: \ntt{% define Zprod \{ ( \$1.x*\$2.x - \$1.y*\$2.y, \$1.y*\$2.x + \$1.x*\$2.y ) \} } \subsection{M4 macros} M4 is a simple but powerful macro language originally distributed with Unix systems \cite{KRm4}, but free versions are available for other operating systems. The use of this language requires an extra processing step, but the power and flexibility of the macros easily make up for it. The macro definitions are read before the text to be processed, typically by a system command such as \ntt{m4 {\sl configurationfile}.m4 {\sl diagram}.m4 | dpic -g \tRA\ {\sl diagram}.tex} An m4 macro is defined as follows: \ntt{define(`{\sl name}',`{\sl contents}')}\\ so that distinct occurrences of {\sl name} will be replaced by {\sl contents} in the following text. This basic description is a vast simplification of the power that results from conditional substitution, recursion, file inclusion, integer arithmetic, shell commands, and multiple input and output streams. The online manual \cite{Seindal94} is a good source of details. A general rule might be that floating point computation is in the domain of dpic macros but text substitution is often better done in m4 macros. When m4 reads text, it strips off pairs of single quotes: thus, {\tt `text'} becomes {\tt text}. If {\tt text} is read again, as when it is a macro argument, for example, then the process is repeated. The single quotes serve to delay the evaluation of macros within {\tt text}, as in macro definitions described above. Therefore, to avoid m4 changing dpic macro definitions or \LaTeX, enclose them in single-quote pairs. Some simple applications of m4 macros are illustrated in the subsections that follow. \subsubsection{M4 branching} As an illustration of m4 macros, suppose that commands that are specific to the postprocessor must be generated. Then the macro \ntt{ifpgf(`{\sl pgf-specific commands}',`{\sl other commands}')}\\ for example, should expand to its first argument if pgf is to be the postprocessor, otherwise it should expand to the second argument. To implement this, {\tt ifpgf} is defined in the statement \ntt{define(`ifpgf',`ifelse(m4postprocessor,pgf,`\$1',`\$2')')}\\ which tests for equality of the character sequences {\tt m4postprocessor} and {\tt pgf}. However, if {\tt m4postprocessor} is a macro, it is replaced by the macro text before the test is performed, and if the macro text is {\tt pgf}, then the first argument of {\tt ifpgf} is evaluated. In the Circuit\_macros package, m4 is required to read a postprocessor-specific file before anything else, and that file contains the required definition of {\tt m4postprocessor}. The built-in macro {\tt ifelse} can have multiple branches, as illustrated below: \ntt{ifelse(m4postprocessor,pstricks,`{\sl PSTricks code}',} \ntt{ m4postprocessor,pgf,`{\sl TikZ PGF code}',} \ntt{ m4postprocessor,mfpic,`{\sl Mfpic code}',} \ntt{ m4postprocessor,mpost,`{\sl MetaPost code}',} \ntt{ m4postprocessor,xfig,`{\sl Xfig code}',} \ntt{ m4postprocessor,postscript,`{\sl Postscript code}',} \ntt{ m4postprocessor,pdf,`{\sl PDF code}',} \ntt{ m4postprocessor,svg,`{\sl SVG code}',} \ntt{ `{\sl default code}')} %\enlargethispage{\baselineskip} \subsubsection{Extending pic: perpendiculars} The Circuit\_macros {\tt vperp} macro illustrates how m4 macros can extend the pic language. The purpose is to generate a pair of values representing the unit vector perpendicular to a given line, say. \vspace*{-0.5\baselineskip} \begin{verbatim} define(`vperp', `define(`m4pdx',`(`$1'.end.x-`$1'.start.x)')dnl define(`m4pdy',`(`$1'.end.y-`$1'.start.y)')dnl -m4pdy/vlength(m4pdx,m4pdy),m4pdx/vlength(m4pdx,m4pdy)') \end{verbatim} The macro can be invoked as {\tt vperp(A)} where {\tt A} is the name of a line. Another invocation might be {\tt vperp(last line)}. First, two macros (beginning with {\tt m4} to avoid name clashes) are defined as the $x$-distance $dx$ and $y$-distance $dy$ of the end of the line from the start. The macro evaluates to the pair $-dy/\sqrt{(dx)^2+(dy)^2},\,dx/\sqrt{(dx)^2+(dy)^2},$ where the denominators are calculated by the macro {\tt vlength}. \subsubsection{Setting directions} The pic language defines the concept of the current drawing direction, which is limited to {\tt up}, {\tt down}, {\tt left}, and {\tt right}. Two-terminal circuit elements, for example, might have to be drawn in any direction, which calls for the ability to define diagrams without knowing their final orientation and to rotate the result at will. This capability can be added to the basic pic language by judicious use of macros. First, instead of specifying positions in the usual way, such as in \ntt{line from (x1,y1) to (x2,y2)}\\ for example, let us agree to write \ntt{line from vec\_(x1,y1) to vec\_(x2,y2)}\\ where {\tt vec\_(x1,y1)} evaluates to \ntt{(a*x1 + b*y1, c*x1 + d*y1)}\\ Then if {\tt a} and {\tt d} are {\tt cos(theta)}, {\tt b} is {\tt -sin(theta)}, and {\tt c} is {\tt sin(theta)}, this transformation corresponds to rotating the argument vector by an angle {\tt theta}. To produce relative coordinates, the macro {\tt rvec\_(x,y)} evaluates to \ntt{Here + vec\_(x,y)},\\ so writing \ntt{line to rvec\_(x1,y1)}\\ draws a line from the current position {\tt Here} to a point {\tt (x1,y1)} defined with respect to rotated coordinates relative to {\tt Here}. The Circuit\_macros package makes extensive use of versions of the above two macros. The angle and transformation constants are set using macros \ntt{Point\_({\sl degrees})}, {\tt point\_({\sl radians})}, or {\tt setdir\_(}{\tt[U|D|L|R|}{\sl degrees}{\tt],}{\sl default}{\tt)}\\ which have angles as arguments. This usage is illustrated by the macro {\tt lbox}, which draws a pic-like box oriented in the current direction. It can be defined as \begin{verbatim} define(`lbox', `define(`m4bwd',ifelse(`$1',,boxwid,`($1)'))dnl define(`m4bht',ifelse(`$2',,boxht,`($2)'))dnl line from rvec_(m4bwd,0) to rvec_(m4bwd,m4bht/2) \ then to rvec_(0,m4bht/2) \ then to rvec_(0,-m4bht/2) \ then to rvec_(m4bwd,-m4bht/2) \ then to rvec_(m4bwd,0) `$3' ') \end{verbatim} \pagebreak The macro is invoked as {\tt lbox({\sl width}, {\sl height}, {\sl type})}; for example, \ntt{Point\_(20); lbox(,{},fill 0.9)}\\ draws a light gray-filled box of default size at an angle of 20 degrees from the horizontal. In the macro, the width and height of the box are first defined, using default values if the first and second arguments are not given. Then a line is drawn to outline the box, and the {\tt fill 0.9} argument is appended to the line command to fill the box. A slightly more elaborate version that encloses the box in {\tt [}, {\tt ]} brackets is given by the Circuit\_macros {\tt rotbox} macro. \subsection{Subscripts\label{Subscripts:}} \Dpic names and labels may have a single subscript of the form {\tt [{\sl expression}]} or a double subscript of the form {\tt [{\sl expression},{\sl expression}]}. The expression values are rounded to the nearest integer. Thus, {\tt x,} {\tt x[4],} and {\tt x[4,2]} are distinct variable names that can be employed in expressions as usual. Similarly, {\tt P} and {\tt P[3]} are distinct labels. Writing the subscript as {\tt [{\sl position}]} for any defined position is allowed and is the same as {\tt [{\sl position}.x, {\sl position}.y]}. Subscripted variables can simplify the storage and manipulation of sequential data, and subscripted labels aid in drawing sequences of objects. %When using older versions of \dpic, %in cases where a double-subscripted variable or label is part of a macro %argument, protect the comma in the subscript with parentheses %by writing, for example, {\tt x[(i,j)]} instead of {\tt x[i,j]}. %Recent versions of \dpic\ do not require this, as the brackets protect %the comma. \subsubsection{Assigning an array of numbers} We can assign an array of numbers to subscripted variables using statements such as \ntt{x[1] = 47} \ntt{x[2] = 63} \ntt{$\vdots$}\\ and so on, but generating the subscripts is inconvenient, particularly when these statements are obtained by editing a data file. One way of entering the data is to employ the m4 macro definition \ntt{define(`inx',`define(`m4x',ifdef(`m4x',`incr(m4x)',1))m4x')}\\ Then, writing \ntt{x[inx] = 47} \ntt{x[inx] = 63} \ntt{$\vdots$}\\ and processing with m4 automatically generates the required subscripts. The macro sets {\tt m4x} to 1 if it is not yet defined, otherwise it increments {\tt m4x}, and then it evaluates to {\tt m4x}. On completion of the assignments, {\tt m4x} has the value of the last subscript. Another way of assigning variables to a subscripted variable is by the definition \ntt{define array \tLB} \ntt{\quad for i=2 to \$+ do \tLB\ exec sprintf("\$1[\%g] = \$\%g",i-1,i); \tRB\ \tRB }\\ which equates the subscripted first argument to the values in argument 2, 3, $\ldots$ so that, for example, \ntt{array(x,9,-4,7,4.2,0,0,7.9,0,0,10,11,12,13,14,10)}\\ assigns the second to sixteenth arguments to {\tt x[1]} to {\tt x[15]} respectively. \pagebreak \Dpic does not define vector operations, but it is easy to write macros for them. For example, macros can be used to define 3-dimensional vectors, transform them, and to project them onto a drawing plane. \subsection{Splines} \Dpic implements standard pic splines by default, as on the left in the following figure, which shows the result of the command \ntt{spline up 1.5 then right 2 then down 1.5}\\[-1.5\baselineskip] \input spline.tex \par %\enlargethispage{\baselineskip} A straight line is drawn along the first half of the first segment and the last half of the last segment. The curve is tangent to the centres of the segments. The dpic result of including an expression after {\tt spline}, as in \ntt{spline x up 1.5 then right 2 then down 1.5}\\ is shown on the right of the figure, as the tension parameter {\tt x} varies from 0.2 to 1.4. The curve begins at the start of the first segment and terminates at the end of the last segment. The tension parameter can be varied to assist in fitting a multisegment spline to a curve. It turns out, for example, that the optimum tension for approximating a circle using four splines is the value 0.551784. \subsubsection{Curve fitting} Splines are drawn with respect to control points, but only pass through the first and last point. Suppose that a sequence of points {\tt X[0]}, {\tt X[1]},~$\ldots$ {\tt X[n]} has been given, and a spline is to be found to pass through each point. The control points {\tt P[0]}, {\tt P[1]},~$\ldots$ {\tt P[n]} have to be calculated. These points satisfy the following equations: \ntt{P[0] = X[0]}\ \ntt{P[i-1]/8 + P[i]*3/4 + P[i+1]/8 = X[i]} for {\tt i = 1} to {\tt n-1} \ntt{P[n] = X[n]}\\ The Circuit\_macros {\tt fitcurve} macro performs the required calculations and draws the spline to pass through the given points. \subsection{Text} Pic interpreters are not wordprocessors, but generate output compatible with \LaTeX\ in the case of \dpic and \groff or \LaTeX\ in the case of \gpic. \Dpic also generates output formats in which font choice and formatting, if any, must be done according to the context, as for example, postscript output containing psfrag strings, or SVG output formatted by macros or by hand. The result is that the size and position of text may need to be adjusted by hand for the particular workflow and postprocessor to be employed. The \dpic\ {\tt textht} environment variable (see \SR{Appendix A:}) often gives \dpic a good estimate of the actual height of embedded text, but the width of the text is more difficult to estimate. Consequently, text is sometimes truncated by the figure bounding box at the left or right edge of the figure. Setting the width of strategic strings by hand, e.g., {\tt "{\it text}" wid 0.65} can serve as a quick cure in specific cases, but is better done automatically as described in the Circuit\_macros documentation \cite{Aplevich09}. Briefly summarized, \LaTeX\ can write the exact height, width, and depth of formatted text (or anything that creates a box) to a file. The file is read by dpic during a second processing of the diagram, so that the width $x$ and height $y$ are known numerical values in the phrase \ntt{"{\sl text}" wid $x$ ht $y$}\\ Text in PDF and SVG output is mentioned further in Section \ref{SVGtext:}. Justified text deserves special mention. The second line in \ntt{A: circle rad 0.01 at (0,0)} \ntt{S: "Hello" at A} \ntt{ box wid S.wid ht S.ht at S}\\ produces a greeting centered at {\tt A} as expected. The bounding box of the text is also centered at {\tt A} but has default height and width {\tt textht} and {\tt textwid} (that is, zero in most cases) respectively. The revised version \ntt{S: "Hello" wid 24.7/72 ht 7.6/72 at A}\\ (where the formatted size in points has been obtained automatically or by measurement) produces a correct bounding box. There are minor differences in the way \gpic and \dpic handle justification, as discussed in Section \ref{Justified:}. \subsection{Postprocessor commands and color} Arbitrary postprocessor commands can be interspersed with pic statements to achieve effects such as gradient fills, clipping, and transformations. There are two ways of passing commands into dpic output. \enlargethispage{\baselineskip} \Dpic lines beginning with the backslash \tBS\ are passed through to the output without modification. This method works well for \LaTeX\ statements and commands to postprocessors that rely on TeX macro processing. The second method is the form \ntt{command "{\sl text}"}\\ or \ntt{command sprintf("{\sl format}",{\sl expression},$\ldots$)}\\ both of which pass the contents of the string into the output stream without the enclosing quotes. The string need not start with a backslash. Both of the above methods add considerable power to the pic language, but there are two issues. The first is that if a postprocessor transformation changes the size of a drawn element, the pic processor will not know the new size parameters unless they are explicitly calculated. The second is the challenge of designing a single macro that produces appropriate postprocessor code to have identical effect with different postprocessors. %The gradient fill operations for \PSTricks or SVG, for example, are a good use %of this facility. Path operations such as clipping can also be used, %depending on the postprocessor. %It is more of a challenge to design %macros that have identical effect with a variety of postprocessors, %since their syntax differs. The Circuit\_macros library contains several routines that produce equivalent or nearly equivalent results for several postprocessors. It is probably a good rule to stick with one or two postprocessors such as Tikz-pgf or \PSTricks. Dpic defines a number of internal variables for controlling actions that depend on output format. Internal variables {\tt optTeX}, {\tt opttTeX}, {\tt optpict2e}, {\tt optPSTricks}, {\tt optPDF}, {\tt optPGF}, {\tt optMFpic}, {\tt optPS}, {\tt optPSfrag}, {\tt optMpost}, {\tt optSVG}, and {\tt optxfig} have numerical values 1 to 12 respectively, and variable {\tt dpicopt} is given the value corresponding to the output format specified on the command line. Therefore, conditional drawing with a {\tt case} statement as described on \PR{Branching:}, or with {\tt if} as in the following can be performed:\\ \ntt{if (dpicopt==optPS) || (dpicopt==optPDF) then \tLB}\\ \hspace*{2em}{\sl drawing commands for postscript or pdf}$\;$ \tRB \tBS \ntt{else \tLB$\;$ {\sl drawing commands for latex-related formats} \tRB}\\ The variable {\tt optsafe} is set to true if option {\tt -z} has been specified or if dpic has been compiled to allow only safe mode. \subsubsection{Color} From version 18, gpic allows coloured lines and filled objects as follows, and dpic allows them where the postprocessor supports them: \ntt{{\sl object} outlined {\sl string}} \ntt{{\sl object} shaded {\sl string}} \ntt{{\sl object} colored {\sl string}}\\ where {\sl string} specifies a colour compatible with the postprocessor. For planar objects, the third case is equivalent to \ntt{{\sl object} outlined {\sl string} shaded {\sl string}}\\ For the linear objects line, arrow, spline, dpic treats \ntt{colored {\sl string}}\\ to be the same as \ntt{outlined {\sl string}}\\ but fill can be added by explicitly writing \ntt{outlined {\sl string} shaded {\sl string}} The original pic language did not include the {\tt outlined} or {\tt shaded} attributes. Current processors recognize these but know nothing about color except as strings attached to drawing elements. What the string should contain depends on the postprocessor. \subsubsection{Filling with color} Basic pic shapes such as boxes, circles, and ellipses can be colored and filled using, for example, \ntt{ellipse shaded "{\sl color}" outlined "{\sl color}"}\\ and, if the two colors are the same, this can be abbreviated as \ntt{ellipse colored "{\sl color}"}\\ where the color strings are compatible with the postprocessor. The \Mfour\ macro \ntt{rgbstring({\sl red fraction,green fraction,blue fraction})}\\ evaluates to a string compatible with the postprocessor (for postprocessors that allow it; that is, \TPGF, \PSTricks, SVG, \MetaPost, PDF, and raw \Postscript) so that the following produces a circle filled in gold, for example: \ntt{circle shaded rgbstring(1,0.84,0)}. More elaborate options can also be invoked. For example, with \TPGF output, the command \ntt{box shaded "orange, opacity=0.5"}\\ sets the opacity of the fill, and with \PSTricks output, the sequence \ntt{box shaded "lightgray,fillstyle=hlines*,linecolor=blue,} \ntt{hatchwidth=0.5pt,hatchsep=5pt,hatchcolor=red,hatchangle=45"}\\ produces a hatched multicoloured fill and is equivalent to \ntt{command "\tBS{}pscustom[fillcolor=lightgray,fillstyle=hlines*,linecolor=blue,"} \ntt{command "hatchwidth=0.5pt,hatchsep=5pt,hatchcolor=red,hatchangle=45]\tLB\%"} \ntt{\quad box} \ntt{command "\tRB\%"} One limitation of the pic language is that it lacks the concept of a path composed of different basic curves such as lines, splines, and arcs. \Dpic, however, extends the {\tt shaded} and {\tt outlined} directives to linear objects such as lines or splines where the output postprocessor allows. Consider, for example, the following macro: \begin{verbatim} define slantbox { [ # wid, ht, xslant, yslant, attributes w = $1 ; h = $2 ; xs = $3 ; ys = $4 NE: (w+xs,h+ys)/2 ; SE: (w-xs,-h+ys)/2 SW: (-w-xs,-h-ys)/2 ; NW: (-w+xs,h-ys)/2 N: 0.5 between NW and NE ; E: 0.5 between NE and SE S: 0.5 between SE and SW ; W: 0.5 between SW and NW C: 0.5 between SW and NE line $5 from N to NE then to SE then to SW then to NW then to N ] } \end{verbatim} \vspace*{-1ex} This macro implements a version of the {\tt xslanted} and {\tt yslanted} attributes recently introduced for gpic boxes, for example \ntt{box wid 0.1 ht 0.5 xslanted 0 yslanted 0.1 \tBS} \ntt{\quad shaded "Dandelion" outlined "black"}\\ The {\tt slantbox} macro defines the implied compass corners {\tt N,} {\tt S}, {\tt NE},~$\ldots$. Its fifth argument can be used to fill or otherwise specify the line. For example, the command \ntt{slantbox(0.1,0.5,0,0.1,shaded "Dandelion" outlined "black")}\\ is equivalent to the gpic example. The above macro can be modified easily to produce arbitrary polygons, for example. The color {\tt Dandelion} is automatically defined for \PSTricks by the \LaTeX\ line \ntt{\tBS{}usepackage[dvipsnames]\tLB{}pstricks\tRB}\\ For TikZ-PGF, try \ntt{\tBS{}usepackage[usenames,dvipsnames]\tLB{}xcolor\tRB} \ntt{\tBS{}usepackage\tLB{}tikz\tRB} \subsubsection{External files} Dpic can send print output to a file (operating system permitting) using the command \ntt{print {\sl arg} \tRA\ "{\sl filename}"}\\ which creates the named file, or \ntt{print {\sl arg} \tRA\tRA\ "{\sl filename}"}\\ which appends output to the named file if it exists and creates the file if not. If the {\tt -z} option has been invoked or dpic was compiled in safe mode, both of these give warning messages rather than writing to the file. External files can be used to implement forward referencing. For example, sometimes the final size of a diagram component is required in order to draw a background object that will be overlaid by the component. One solution is to process the diagram twice. In the following code fragment, an assignment to {\tt x} is written to an external file so that the required value of {\tt x} will be known after the file is read on the second pass. %\enlargethispage{\baselineskip} \ntt{x = {\sl default value}} \ntt{print "" >> "datafile" \hfill \# Make sure the file exists} \ntt{copy "datafile" \hfill \# On second pass, read x = required value} \ntt{{\sl ... draw objects and calculate required value y ...}} \ntt{print sprintf("x = \%g",y) > "datafile"\hfill \# Write out the assignment} \\ %=============================================================================== \section{SVG, PDF, and Postscript output}\label{SVG:} The {\tt-r} (raw \Postscript), {\tt-v} (SVG), {\tt-d} (PDF), and {\tt-x} (\xfig) options of dpic produce output that is not intended to be processed directly by \LaTeX\ or, in some cases, printed on paper. % \Postscript output can be inserted %into a document with the {\tt \tBS{}includegraphics} macro. This command %will also import pdf for processing by pdflatex. As a ``little language,'' \Pic and its interpreters leave text sizing and formatting to word processors, which are flavours of \LaTeX\ in the case of \dpic, and \groff or \LaTeX\ in the case of \gpic. Text formatting is specified by the text content itself or by the string contents of {\tt command} lines. The exception to this is that text is also a graphical element; its size and location is sometimes required, and the interpreter must also be able to stack multiple text strings vertically. In most cases, placing text using \ntt{"{\sl Text}" wid {\it x} ht {\it y} at {\it location}}\\ is sufficient. \LaTeX\ can write the height and width of the formatted text (which can be anything that produces a TeX box) to an external file, which is passed to the \pic processor for use on a second pass over a diagram, as described in detail in reference \cite{Aplevich09}, so the values of {\it x} and {\it y} can be obtained automatically and macros can generate the above line without intervention by hand. Other output formats, however, require different treatment. This is specially true of SVG output for the web. % There are several issues: selecting the font and determining the % height, width, and position of text. \subsection{SVG text\label{SVGtext:}} In contrast with the various dpic \LaTeX\ output formats for which text size is established by postprocessor commands, the size of SVG text has to be set by the \pic interpreter (at least until an automatic way of returning formatted sizes from renderer back to \pic interpreter is established). \begin{wrapfigure}[9]{r}{0.3\textwidth}% \vspace*{-\baselineskip}% \hspace*{1em}% \parbox{0.3\textwidth}{\input{Xtest.tex}}% \end{wrapfigure}% One issue is that the formatted height of text is generally a fraction of the nominal size. For example, the Times letter X at 100\,bp placed on a 100\,bp by 100\,bp grid is shown at the right. The height of the X is approximately 66\,bp or 0.66 of the nominal height. This ratio depends on the font. Consequently, a language issue arises: if the attribute {\tt ht~{\it y}} is to be used to set text size, should the value of {\it y} be the nominal height (the point size) or the formatted height of the text? % Initial versions of the experimental % SVG output of \dpic used the % nominal height but later versions now conform to \LaTeX\ usage by treating \Dpic treats {\it y} as the true graphical height in drawing units. Thus for example, {\tt "text" ht 10*(scale/72)} produces output {\tt 10bp} high. To assist with the above and similar issues when the {\tt -v} option is invoked, \dpic performs the equivalent of \ntt{dpPPI = 96} \ntt{dptextratio = 0.66}\\ in the outermost scope of the diagram. These are ordinary variables that can be referenced or changed as usual. The variable {\tt dpPPI} is given the inital value 96 which is pixels per inch on a 20-inch wide computer monitor of 1920 pixels width. On such a monitor, dpic output should be close to true size. This parameter can be changed using the assignmnent \ntt{dpPPI := {\sl value}}\\ for different screen resolution, and {\tt dptextratio} can be similarly changed. (For \xfig\ output, the following are defined under the {\tt -x} option: {\tt xfdispres = 80; xfigres = 1200}.) When \dpic sees the {\tt ht {\it y}} attribute attached to SVG text, it sets the nominal text size to $y/\tt{dptextratio}$ expressed in points. Otherwise, \dpic uses the current value of the environment variable {\tt textht}, which has default value $11/72 \times 0.66,$ to set the default size to 11\,bp. The Circuit\_macros configuration file {\tt svg.m4} contains a macro {\tt svg\_font} that can simplify font specification, and a macro {\tt svgfontratio} that can be used to set {\tt dptextratio} and {\tt textht} automatically for common HTML fonts. \Dpic sets the width of text to the current value of {\tt textwid} by default but, as always, it is best not to rely on default behaviour. Specify the object (text in this case) completely using {\tt wid {\it expression} ht {\it expression}}. In the absence of an automatic means of determining it, text width can be measured approximately when displayed full-size on a monitor. Fortunately on many diagrams, knowing the width is unnecessary or is required for only a few key strings. In principle, this process might be automated using suitable macros and scripting (JavaScript, probably). \enlargethispage{\baselineskip} \subsection{Bounding boxes} The bounding box of a diagram is not always known exactly or even defined exactly, since it can depend on the context in which the diagram is to be used. Within a diagram, different line widths, mitred joints, splines, colored output, overpainting, arbitrary text, arbitrary \Postscript or SVG, and other complications are allowed; consequently dpic can only provide an estimate of the exact bounding box. Strategic {\tt move} commands can be used to enlarge the bounding box as illustrated at the end of the discussion below. Dpic uses the constant-width Courier font in pdf files, thus allowing the width of strings to be calculated from their height, which is specified by {\tt textht} with default $11\,$pt, or by the ``{\tt height} {\sl expression}'' attribute. The string width is calculated from the height and character count, but can be set explicitly by using {\tt width} {\sl expression} as the rightmost string attribute. {\em Psfrag output} is another special case. If {\tt textht} is set to a nonzero value, then its value relative to $11\,$bp is given as a scale factor to the psfrag {\tt \tBS{}tex} command. An alternative way of changing the diagram text height is to set it in the main document; for example, {\tt \tLB\tBS{}small \tBS{}includegraphics\tLB{\sl file}.eps\tRB\tRB}. {\em Postscript bounding boxes:} For a while, the dpic\verb|%%BoundingBox| output line simply gave the nominal bounding box determined by line ends and other control points. The use of dpic in server mode has induced a change that correctly defines the bounding box for very basic diagrams. More explicitly, consider \begin{verbatim} .PS box with .sw at 0,0 .PE \end{verbatim} which draws a box with southwest corner line centres intersecting at \Postscript coordinates 0,0 and northeast intersection at 54,36. Dpic {\tt -r} augments this nominal bounding box by half of the last {\tt linethick} value (default {\tt linethick} is 0.8 bp) in the outermost diagram scope to produce the \Postscript bounding-box definitions \begin{verbatim} %%BoundingBox: -1 -1 55 37 %%HiResBoundingBox: -0.4 -0.4 54.4 36.4 \end{verbatim} The\verb|%%BoundingBox| line contains integer values that enclose the high-resolution coordinates. {\em PDF bounding boxes:} PDF includes a MediaBox element which serves approximately the same purpose as the postscript BoundingBox, and is calculated the same way. By default, dpic puts the lower left corner of PDF output at coordinates $(0,0)$. {\em Manual bounding box adjustment:} It may be necessary to adjust the bounding box manually. To zero the automatic adjustment, put {\tt linethick=0} at the end of the outermost scope. Then arbitrary margins can be added to the nominal box as shown below, where 2, 1, 1, and 0 points are added to the left, bottom, right, and top margins respectively:\\ \ntt{.PS} \ntt{Diagram: [} \ntt{\quad{\sl drawing commands}} \ntt{]} \ntt{linethick = 0} \ntt{move from Diagram.sw-(2,1)/72*scale to Diagram.ne+(1,0)/72*scale} \ntt{.PE} %=============================================================================== \section{Pic processor differences}\label{Diffs:} Differences among processors, and between dpic and gpic particularly, are summarized below. These differences result from incomplete language definition and from different implementation contexts. Normally, the only changes required to process correct pic or gpic input with dpic are changes to \tLB$\ldots$\tRB\ instead of {\tt X}$\ldots${\tt X} syntax as explained below, together with text formatting if the original code was written for \groff. Sometimes, differences in default behavior (such as for arcs or object placement) must be considered. The remaining items are reasonably small syntactical differences or relate to the use of \LaTeX\ or the other dpic output formats. %Gpic is being actively maintained so some of the items below apply only %to older versions. \subsection{Command-line options} They are completely different, of course. Type dpic -h to see a list of dpic options. \subsection{Output formats} Gpic {\tt-t} output consists of a sequence of\verb|\special| statements contained in the TeX box\verb|\box\graph|. The\verb|\special| statements are automatically copied into the {\tt.dvi} file for interpretation by a printer driver such as dvips. Dpic does not generate tpic specials. See the option list in \SR{Usage:} for output formats. \subsection{``{.}'' and ``\textbackslash''\ lines} Gpic passes lines beginning with {\tt.}\ through to the output, thereby allowing arbitrary Troff macros to be interspersed with pic drawing commands. Some programs that generate pic output automatically insert the Troff line \ntt{.ps 11}\\ on the assumption that the text point size should be 11. Dpic ignores non-continuation lines beginning with {\tt.}\ within pictures. Some programs (e.g., pstoedit) add Troff comment lines beginning with\verb|.\"| outside the {\tt.PS}, {\tt.PE} delimiters. These lines must be dealt with separately. Both gpic and dpic pass lines beginning with \tBS\ to the output. \subsection{{\tt for}-loop and {\tt if} bodies} In gpic, a for loop has the form \ntt{for {\sl variable} = {\sl expr1} to {\sl expr2} {\rm[}by {\rm[}*{\rm]}{\sl expr3}{\rm]} do X {\sl body} X}\\ where {\tt X} is any character not occurring in {\sl body}, but \tLB\ {\sl body} \tRB\ is also allowed. In dpic only the latter is allowed. Similarly, the required form of an if statement for dpic is \ntt{if {\sl expr} then \tLB\ {\sl if-true} \tRB\ {\rm[}else \tLB\ {\sl if-false} \tRB{\rm]}} The test for termination of the multiplicative form of the for loop is not identical for dpic and gpic but the effects are identical for positive parameters. Both gpic and dpic allow the loop index variable to be changed within the loop, so infinite repetition or control of termination by a test are possible. \subsection{Closing braces and nul elements} In some cases where the contents of {\tt \tLB \tRB} are scanned, a semicolon or newline must be inserted prior to the closing brace to ensure that the contents of the braces are completed before exit. Such a case occurred in the definition of the {\tt case} macro on \PR{Branching:}. Similarly, a semicolon or newline is required in the following {\tt if} test with an {\tt else} clause: \ntt{if (sh "test -f fileA.pic")==0 then \tLB $\;$ copy "fileA.pic"; \tRB \tBS} \ntt{else \tLB $\;$ copy "fileB.pic" \tRB}\\ The semicolon ensures that the {\tt copy} command completes before exiting the first pair of braces. In the following lines, gpic ignores the {\tt \tLB \tRB} braces enclosing the trivial for-loop in the first line and the if-test in the second line. Consequently, the {\tt "x"} labels are misplaced. Dpic places the labels correctly. The cure for gpic is to put a semicolon or newline between the rightmost braces. \ntt{\tLB for i=1 to 1 do \tLB line right\tRB\tRB; "x"} \ntt{move; i=1; \tLB if i==1 \tLB line right\tRB\tRB; "x"} %\subsection{Nul elements} Gpic gives error messages if there is nothing or nothing more than newlines or semicolons between ``{\tt \tLB\ \tRB}'' braces or ``{\tt [ ]}'' brackets. These constructs do not occur often in hand-generated code (although {\tt []} is sometimes convenient) but \Mfour\ or other macros containing conditional expansion can generate them unless care is taken to avoid them. Dpic allows both items, with {\tt [ ]} generating a block of zero size. \subsection{End of line} The line end is significant in the pic grammar. However, dpic ignores line ends following {\tt then}, {\tt \tLB}, {\tt :}, {\tt else}, or end of line. Both the CR (octal 015) and NL (octal 012) characters are treated as line ends. If the last character of a line is \tBS\ (but not within a string), then reading is continued on the next line. Dpic allows this to occur within keywords or constants. Strings can contain multiple lines. The {\tt\#} character begins a comment which ends at the end of the line. The construction \ntt{if {\sl condition} then \tLB\ {\sl if-true} \tRB} \ntt{else \tLB\ {\sl if-false} \tRB}\\ produces an error with all pic interpreters. To avoid this error, write \ntt{if {\sl condition} then \tLB\ {\sl if-true} \tRB\ \tBS} \ntt{else \tLB\ {\sl if-false} \tRB}\\ \subsection{Logic} Dpic and gpic give slightly different default precedences to the logical operators {\tt !}, {\tt \&\&}, {\tt ||}, {\tt ==}, {\tt !=}, {\tt >=}, {\tt <=}, {\tt <}, and {\tt >}, so judicious use of parentheses may sometimes be in order. Dpic also requires comparisons and logical operations to be put in parentheses in numerical expressions; e.g., \ntt{x = ("{\sl text1}" == "{\sl text2}")} The construct {\tt x} is intended to have the same meaning as {\tt (x between A and B)} but, in some obscure circumstances, all pic interpreters have difficulty determining whether the {\tt<} character is part of such an expression or is a logical comparison operator. Dpic treats {\tt<} as a comparison in the expression following {\tt if} so the form {\tt(x between A and B)} should be used in such expressions, e.g. \ntt{\tt if (0.5 between A and B).y < 2 then }\tLB~$\ldots$ \tRB\\ % In all cases, putting comparisons inside parentheses will % render them robust to logical agreement and to error messages. \iffalse \subsection{{\tt then}} Versions of gpic up to 1.19 ignore the {\tt then} keyword, so that \ntt{line -> then up 0.5}\\ draws one line segment and is the same as \ntt{line -> up 0.5}\\ whereas dpic does not ignore {\tt then}, and draws two line segments. Newer versions of gpic also draw two segments. \fi \subsection{Defaults for {\tt line}, {\tt spline}, {\tt arrow}, {\tt move}} Dpic treats the defaults for linear objects consistently with planar objects with respect to the {\tt at} modifier. % Versions of gpic up to 1.19 treated Gpic treats them differently: In dpic, {\tt line at Here} means {\tt line with .center at Here}.\\ In gpic, {\tt line at Here} means {\tt line with .start at Here}. In dpic, the location corresponding to {\tt last line} is {\tt last line.c}.\\ In gpic, the location corresponding to {\tt last line} is {\tt last line.start}. With dpic, % In current versions of dpic, {\tt last line.wid} returns the arrowhead width of the line or the default arrowhead width if the line has not been given an arrowhead; similarly for {\tt .ht} and for the other linear objects including {\tt move} and, of course, {\tt arrow}. The compass corners of multisegmented linear objects are not defined in descriptions of the \pic grammar; reasonable positions are returned but they should be used with care. \subsection{Arc defaults} Gpic and dpic have different algorithms for picking a default radius. The best practice is to specify arcs completely. There is also ambiguity in the pic language. The statement \ntt{arc cw rad x from A to B}\\ does not define a unique arc. There are two arcs that satisfy this specification, with centres on opposite sides of the line joining {\tt A} and {\tt B}. Dpic will choose one by attempting to minimize the angle between the current direction and the initial tangent of the arc. Instead, use \ntt{arc cw from A to B with .c at C} \subsection{Strings} % and justified text\label{Strings:}} Strings are arbitrary character sequences between double quotes. % with double %quotes in strings preceded by the backslash character. Equivalently, a string is produced by the C-like sprintf function \ntt{sprintf("{\sl format}" {\rm[}, expression,~$\ldots$ {\rm]})}\\ The C snprintf function is used for implementing this; therefore, the precision of default formats such as {\tt \%g} may vary by machine and compiler. To produce transportable results, specify the precision completely, e.g., {\tt \%8.5f}. As in C, the pair {\tt \%\%} in the format string prints the percent character. Only the {\tt f}, {\tt e}, {\tt g} formatting parameters are valid, since expressions are stored as floating-point numbers, e.g. \ntt{line sprintf("\%g\%g0", 2, 0 ) above}\\ is equivalent to \ntt{line "200" above} \enlargethispage{\baselineskip} Similarly, \ntt{command sprintf("\tBS{}pscircle(\%g,\%g)\tLB\%g\tRB",0,0,0.5)}\\ places a line containing the formatted string without the quotes into the output. The numerical {\tt sprintf} arguments can be arbitrary expressions in place of the constants shown. Dpic allows strings to be concatenated by the {\tt+} operator; thus, \ntt{"abc" + sprintf(" def\%g",2)}\\ is equivalent to {\tt"abc def2"}. In a macro, a dollar sign followed by an integer in a string will expand to the corresponding macro argument if it is defined. Separate the dollar sign from the integer to avoid expansion, as in the TeX strings {\tt"\tLB\tBS\$\tRB{}1"}, {\tt"\$\tBS\$ 1\$"}, or {\tt"\$\tLB 0\tRB\$"}, for example. Both dpic and gpic treat \tBS\ as an escape character prior to the double-quote character in a string, so {\tt"\tBS""} is a length-one string containing the double quote. Otherwise, the backslash is an ordinary string character. For example, the characters\verb|\\"u| in a string are output as\verb|\"u| to produce \"u when processed by \LaTeX. A string with a backslash as last character has to be generated using a macro; for example, if we write {\tt define charstr \tLB"\$1"\tRB} then {\tt charstr(abc\tBS)} evaluates to a string containing the required final backslash. Gpic implements the attribute {\tt aligned} of an object to rotate attached strings by sending commands to postprocessor {\tt grops} or {\tt gropdf,} which translate troff output to postscript or pdf respectively. The bounding box of the rotated string is unknown. Dpic does not define this attribute but allows the user to rotate text directly when permitted by the postprocessor. For example, the Circuit\_macros macro {\tt rs\_box} rotates text for \PSTricks\ or TikZ-PGF output and calculates the bounding box. For SVG output, {\tt svg\_rot()} has a similar function. The following simple pic macro accomplishes the same goal for \PSTricks\ and \TPGF\ but the resulting text bounding box is not calculated. \begin{verbatim} # dprtext(degrees,text) define dprtext {[ if dpicopt==optPSTricks then { sprintf("\rput[c]{%g}(0,0)",$1)+"{$2}"} else { if dpicopt==optPGF then { sprintf("\pgftext[rotate=%g]",$1)+"{$2}" }} ]} \end{verbatim} Then, for example, {\tt dprtext(45,Hello) at {\sl position}} places the text ``Hello'' rotated 45$^{\circ}$ at the specified position. A string cannot be assigned to a varable name; the nearest equivalent is to define a macro containing the string as the body. Both dpic and gpic allow logical comparison of strings. Put the comparison in parentheses if it is to be used in an expression. String height and width are unscaled on final output from dpic since these may depend on later formatting by \LaTeX. Gpic does not allow newlines in strings; dpic does, with an upper limit of 4095 characters. \subsection{{\tt print} {\sl arg},~$\ldots$} Dpic allows only one argument, which may be an expression, position, or string. To print several quantities at once, use \ntt{print sprintf($\ldots$)}\\ to generate a string and, if the string is complicated, remember that {\tt {\sl string1} + {\sl string2} +~$\ldots$} evaluates to one string. \subsection{{\tt command} {\sl arg},~$\ldots$} Arbitrary commands are sent to the standard output stream. Dpic allows only one argument, which is a string or {\tt sprintf($\ldots$)}. \subsection{Operating system commands} With dpic, the required form for a shell (operating system) command is \ntt{sh "{\sl shell command}"}\\ or \ntt{sh sprintf("{\sl format}",{\sl expression},$\ldots$)}.\\ The value returned by the operating system can be captured by putting the command in parentheses; for example, \ntt{if (sh "{\sl shell command}") == 0 then \tLB\ldots\tRB } \subsection{{\tt copy}} \Dpic supports the command \ntt{copy "{\sl filename}"}\\ but does not directly support the \gpic commands \ntt{copy {\rm[}{\sl filename}{\rm]} thru X {\sl body} X {\rm[} until {\sl word} {\rm]}} \ntt{copy {\rm[}{\sl filename}{\rm]} thru {\sl macro} {\rm[} until {\sl word} {\rm]}} These functions and many more are readily implementable with dpic in any Unix-like environment. % To customize an operation such as % \ntt{copy {\sl filename} thru {\sl macro}}\\ % modify the following example, as appropriate. % This usage is not as % simple as a built-in function but allows much more flexibility of data. %\begin{verbatim} % .PS % # Suppose that file.dat contains rows of data % # delimited by spaces. % % # Macro to process a row of data, e.g. % # save the first 4 values: % define store { n = n+1; x[n] = $1; y[n] = $2; z[n] = $3; w[n] = $4 } % % # Use sed to convert the data to a sequence % # of calls to the store macro: % sh "sed -e 's/^ */store(/' -e 's/ *$/)/' -e 's/ */,/g' file.dat >tempfile" % % # Initialize the counter and process the data % n = 0; copy "tempfile" % # Delete the temporary file % sh "rm tempfile" % .PE %\end{verbatim} For example, a basic implementation of {\tt copy {\sl filename} thru {\sl macro}} is given by the following macro: \begin{verbatim} # copythru(macro_name,"filename") # Implements copy filename thru macro_name # for data separated by commas, spaces, or tabs define copythru { sh "sed -e 's/^[ \t]*/$1(/' -e 's/[ \t]*$/)/' \ -e 's/[, \t][ \t]*/,/g' $2 > copy_tmp__" copy "copy_tmp__" sh "rm -f copy_tmp__" } \end{verbatim} The lines of the {\sl filename} file are changed to calls of the {\tt macro\_name} macro and written into a temporary file, which is then read by \dpic. Such usage is not as simple as a built-in function but allows greater flexibility of data because the {\tt copythru} macro can be replaced by one customized to suit. For example, the {\tt sh} command might invoke another program to generate the data. \subsection{{\tt plot}} The {\tt plot} command is deprecated in gpic and not allowed in dpic. \subsection{{\tt fill}} In gpic, a fill value of 0 means white, 1 means black. Dpic uses 0 as black and 1 as white as do \Postscript and the original ATT pic. The pic language specifies fill only for box, ellipse, and circle. With dpic, the {\tt shaded} directive fills a path defined by a linear object, where allowed by the postprocessor. The concept of a path containing several arbitrary linear objects does not exist in the pic language but can be implemented using postprocessor commands inserted into {\tt command {\sl string}} statements. Arbitrary paths can also be constructed using a single spline and the {\tt continue} statement. \pagebreak \subsection{Scaling} Dpic implements a {\tt scaled} attribute, so that \ntt{box scaled 1.2}\\ produces a box with dimensions scaled by 1.2, and \ntt{[box; line scaled 3; circle] scaled 0.5}\\ scales all objects within the block by 0.5. The latter can be used when different parts of a diagram require different scaling. For example, if file {\tt component.pic} contains a component scaled by 25.4, then the following allow it to be used: \ntt{[ copy "component.pic" ] scaled 1/25.4}\\ As always, line thicknesses are not scaled. \subsection{Arrowheads} Pic processors provide a limited variety of built-in arrowhead shapes. Dpic draws arrowheads according to the environment variable {\tt arrowhead} as shown below. \par \input arrow.tex \par Any other value of {\tt arrowhead} produces the default filled head shown but also results in a head shape native to the postprocessor in some cases. The default value of {\tt arrowhead} is 1 in conformance with other pic processors. Postprocessor parameters can be changed using lines of the form \ntt{command "{\sl postprocessor commands}"} % Dpic also allows arrowhead shape to be locally specified by appending % a parameter after {\tt ->}, {\tt <-}, or {\tt <->}; for example, % \ntt{line -> 0 thick 3 wid 0.2 ht 0.3 ... } Changing the line thickness does not affect arrowhead size parameters, which have to be changed explicitly by either of the following methods. The line thickness is specified in points but the arrowhead size parameters are in drawing units: %\enlargethispage{0.5\baselineskip}\vspace*{-0.5\baselineskip} \begin{verbatim} # Method 1 (global change within the current block): linethick = 2 # default 0.8 (bp) arrowht = 0.18 # default 0.1 (in) arrowwid = 0.09 # default 0.05 (in) arrowhead = 0 # default 1 arrow # Method 2 (put a type 0 arrowhead on the current object): arrow -> 0 thick 2 ht 0.18 wid 0.09 \end{verbatim} There is a subtle language problem concerning arrowheads. Let us agree that the following examples should all produce an arrow of length 1 inch and arrowhead width 1 millimetre: \begin{verbatim} .PS arrow right 1 width 1/25.4 .PE .PS scale = 25.4 arrow right 25.4 width 1 .PE .PS 1 arrow right 1/4 width 1/25.4 .PE \end{verbatim} The original (ATT) pic fails on the second example, insisting that arrowhead dimensions be given in inches. Gpic fails on the third by scaling the arrowhead on final output. Although it might be argued that this is a feature, it causes serious awkwardness when diagrams are to be scaled to exact final dimensions using the {\tt.PS} $x$ construction, since the effective scale factor is unknown until the {\tt.PE} line is processed. Dpic generates the same arrow in all three cases, treating arrowhead parameters like line thickness (unscaled) parameters on final output. \subsection{Compass corners and justified text\label{Justified:}} Dpic consistently requires a dot before compass corners, so the gpic line \ntt{x at center of last box}\\ should be written for dpic as \ntt{x at .center of last box} Justification is performed by the postprocessor, and combining justified text with drawing elements requires special consideration. The lines \ntt{S: "Hello" wid 24.7/72 ht 7.6/72 at A ljust} \ntt{box wid S.wid ht S.ht at S}\\ produce a box of the correct size but centered at {\tt A} because the location ({\tt A}) and a justification command are given to the postprocessor. This behavior could be easily changed but would affect much legacy code and has been kept for \dpic, which will produce a justified box using \ntt{box wid S.wid ht S.ht with .w at S.w} \Gpic and \dpic place justified text slightly differently. In the previous example, \gpic places the text with its left edge exactly at {\tt A}, with similar effect for right justification. \Dpic uses the environment variable {\tt textoffset}, which is 2.5\,bp by default, to place the left edge of the text at {\tt A + (textoffset,0)} with a similar gap for other relative positioning. Assigning {\tt textoffset} to 0 sets the gap added by \dpic to zero. \subsection{{\tt continue}} In dpic, the {\tt continue} command appends a linear drawn object to the previous drawn object as if {\tt then} had been used in the original command, but calculations can be performed to determine size or placement of the appended part as in, for example, \ntt{line up right} \ntt{\quad\sl calculations} \ntt{continue down} \ntt{\quad\sl more calculations} \ntt{continue up left} The keyword {\tt continue} can also be used slightly differently. The line drawn by \ntt{move to (0,0); line right 1 then to (Here,(2,1))}\\ terminates at {\tt(0,1)} since {\tt Here} is the position {\tt(0,0)}, whereas the following terminates at {\tt(1,1)} since {\tt Here} is {\tt(1,0)}: \ntt{move to (0,0); line right 1; continue to (Here,(2,1))} % Input parsing would be possible if {\tt continue} were to be replaced by % {\tt then}: % \ntt{move to (0,0); line right 1; then to (Here,(2,1))}\\ % The keyword {\tt continue} is not strictly necessary % but it has been retained for historical compatibility. \subsection{Subscripted variables and labels} Dpic allows subscripted variables and capitalized labels, as described in \SR{Subscripts:}. \iffalse as an aid in geometric calculations such as fitting splines to a set of points. For example, {\tt Pos[{\sl expression}]} is a valid name for a position. The rounded integer value of the expression is used. Up to two subscripts are allowed, and {\tt x[{\sl expression},{\sl expression}]} is a valid variable name. There are no array operations, but it is easy to write macros for them. \fi \subsection{Splines} Gpic extends the ATT pic grammar to make {\tt line 0.5} legal and mean ``a line of length 0.5 in the current direction.'' All linear objects are treated similarly. Dpic does the same except for splines. In the statement \ntt{spline $x$ from A to B then to C}~$\ldots$\\ the parameter $x$ is a tension parameter, normally between 0 and 1, to control the spline curvature. If $x$ is not present as in the normal pic grammar, the curve starts with a straight line halfway along the first segment and ends with a straight line along the second half of the last segment. When $x$ is present however, dpic draws the spline from the start of the first segment to the end of the last segment. \subsection{Arithmetic} In an expression, \gpic allows terms of the form {\tt x*-y}, whereas \dpic produces an error message. Use {\tt x*(-y)} or the equivalent. \Dpic allows the assignment operators {\tt +=}, {\tt -=}, {\tt *=}, {\tt /=}, {\tt \%=}, which do not create a new variable but update the value of the variable already defined. Thus, the assignment {\tt x += 1} is equivalent to {\tt x := x + 1}. \subsection{Vector arithmetic} The dpic grammar permits the following: \ntt{X: Y + Z}\\ where {\tt Y} and {\tt Z} are defined positions. Gpic requires \ntt{X: Y + (Z.x,Z.y)}\\ Dpic also allows scalar postmultiplication: \ntt{X: Y*2/3}\ (but not {\tt X: 2/3*Y}) \iffalse \subsection{Positions} If {\tt X} is a position, then {\tt (X)} is a valid position for dpic but not old versions of gpic, which gave an error for \ntt{(a between A and B) + (x,y)}\\ Dropping the parentheses to avoid the error gives \ntt{a between A and B + (x,y)}\\ which is not the same resulting position. Use dpic or a recent gpic if you need this construction. \fi \iffalse \subsection{{\tt int()}} Dpic provides both the {\tt floor()} and {\tt int()} functions but {\tt int()} does not compute the same value as pre-1.19 versions of gpic {\tt int()} for non-integer negative arguments. \fi \subsection{{\tt exec}} In dpic the contents of a string can be executed using \ntt{exec {\sl string}}\\ or \ntt{exec sprintf({\sl format string}, {\sl args})}\\ as if the string were the next line of input. This enables the programmed generation of names and labels, for example: \ntt{for i=1 to 10 do { exec sprintf("A\%g: x\%g,y\%g",i,2*i,3*i) }} \subsection{Functions} A few additional mathematical functions are defined in dpic: {\tt abs}, {\tt acos}, {\tt asin}, {\tt expe}, {\tt floor}, {\tt loge}, {\tt sign}, {\tt tan}, and {\tt pmod}. %\subsection{PSTricks anomaly} % At some time between the years 2000 and 2010, % the behaviour of the low-level \PSTricks command % {\tt \tBS{}psbezier} % was changed to match the existing context-dependent behavior % of the {\tt \tBS{}pscurve} command within the\verb|\pscustom| environment% %\footnote{% % The context-dependency of {\tt \tBS{}pscurve} was taken to be a feature % rather than a bug. % An alternative that preserves command orthogonality would have been % to define two curve (and spline) commands for the in-pscustom and out of % pscustom contexts. %% presumably without consideration of independently %% generated coordinate data. %% Since curve-defining code then has to be modified %% depending on where it occurs with respect to {\tt \tBS{}pscustom}, %% the functionality could have been kept while preserving command %% orthogonality by the use of command options or additional commands. % Such are the difficulties of software library maintenance.% %}. % \Dpic does not generate the {\tt \tBS{}pscurve} command, % but the new behaviour affects \dpic-defined filled splines. % The ``normal'' \PSTricks spline syntax is % \ntt{\tBS psbezier(x1,y1)(x2,y2)(x3,y3)(x4,y4)~$\ldots$}\\ % However, if a correctly defined path containing this spline as its second % or later subpath is now enclosed in a\verb|\pscustom| environment, the % path coordinates are incorrect; %% the\verb|\psbezier| command is not the %% first segment of a path within a\verb|\pscustom| environment then % {\tt (x1,y1)} must be omitted since, under these % conditions,\verb|\psbezier| % takes its first coordinate pair to be the current position. % This anomaly would not % be a significant problem if it were always known at the time of % generating the\verb|\psbezier| coordinates whether the curve will be enclosed % within\verb|\pscustom|, but such is not the case. % %% Within the pic language in particular, the\verb|\pscustom| command may be %% introduced via {\tt command} {\sl string} independently of anything else, %% so \dpic cannot know automatically %% whether\verb|\pscustom| has been invoked. % % Dpic always generates four (or % more) coordinate-pair arguments as in the normal syntax, sometimes % resulting in the addition of an extraneous path segment produced % within\verb|\pscustom|. % % For some versions of \PSTricks, % a workaround for the problem has been to insert a % \PSTricks patch in your \LaTeX\ code if you are enclosing splines % within\verb|\pscustom| commands. % More recent versions of the \PSTricks package have changed % again but, starting from the % August~27, 2010 {\tt pstricks.tex} distribution file, a parameter % {\tt noCurrentPoint} has been introduced, % which prevents\verb|\psbezier| (and other commands) % from taking the current point as the first coordinate pair. % The following line inserted into a latex document avoids an % error if the \PSTricks version is August 2010 or later: %\begin{verbatim} % \psset{noCurrentPoint} %\end{verbatim} %% As a result, the following file inserted into a latex document seems %% to handle both cases in which a workaround is possible: % Older versions of \PSTricks are handled using the following workaround: %\begin{verbatim} %command "\makeatletter\@ifundefined{ifPst@noCurrentPoint}% %{\@ifundefined{MPS@Patch}{\gdef\MPS@Patch{}% % \typeout{ Dpic -p: patching psbezier in pstricks.tex (some versions) }% % \def\psbezier@ii{\addto@pscode{% % \ifshowpoints true \else false \fi\tx@OpenBezier% % \ifshowpoints\tx@BezierShowPoints\fi}\end@OpenObj}}{}}% %{\@ifundefined{MPS@PatchMsg}{\gdef\MPS@PatchMsg{}% % \typeout{ Dpic -p: Setting noCurrentPoint to use all coord pairs }}{}% % \psset{noCurrentPoint}}\makeatother%" %\end{verbatim} % % This patch need only be executed once per \LaTeX\ run rather than with % every diagram. % % If the above fix does not work then, for now, % do not insert {\tt spline} commands into paths within the {\tt \tBS pscustom} % environment, {\em unless} the spline is the first path segment. It is probably % safe to say that this anomaly does not occur very often, but it % can cause considerable difficulty when it does; the cure is to update your % \PSTricks files. % % Legacy diagrams can often be treated in the following way, if pstricks97.tex % is available on your machine as in MiKTeX distributions, for example. % Replace the line\verb|\usepackage{pstricks}| % with\verb|\usepackage[97]{pstricks}| or\verb|\input{pstricks97.tex}|. % However, this method precludes using the newer \PSTricks facilities. \section{References} \bibliographystyle{plain} \renewcommand{\refname}{\vspace*{-\baselineskip}} \bibliography{./dpic-doc} %=============================================================================== \clearpage \section{Appendix A: dpic man page}\label{Appendix A:} \input dpic_man.tex %=============================================================================== \clearpage \section{Appendix B: dpic grammar}\label{Appendix B:} The tokens recognized by the dpic parser are as shown. The tokens in {\tt <} {\tt >} pairs are generated internally. Equated tokens ({\tt ";" = ""}) have identical effect. \begin{verbatim} terminals: "<" "cw" "ccw" "(" ")" "*" "+" "-" "/" "%" ";" = "" "^" "!" "&&" "||" "," ":" "[" "]" "{" "}" "." "[]" "`" "'" "=" ":=" "+=" "-=" "*=" "/=" "%=" (* the order matters *) "&" "" "" "