#!/bin/sh # This is a shell archive (produced by GNU sharutils 4.2). # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 1999-07-30 19:10 MET DST by . # Source directory was `/usr/local/work/users/ian/src/fgldoc-2.00'. # # existing files WILL be overwritten # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 54 -rw-r--r-- FGLDOC-2.00 # 1665 -rw-r--r-- Makefile.in # 2541 -rw-r--r-- README # 2549 -rw-r--r-- aclocal.m4 # 205 -rw-r--r-- config.h.in # 49897 -rwxr-xr-x configure # 1019 -rw-r--r-- configure.in # 5558 -rw-r--r-- fgldoc.1 # 16957 -rw-r--r-- fgldoc.c # 1241 -rw-r--r-- fgldoc.h # 4776 -rw-r--r-- fgldoc.txt # 5585 -rwxr-xr-x install-sh # 3741 -rw-r--r-- lexer.l # 3543 -rw-r--r-- parser.y # 3558 -rw-r--r-- read_pdbs.ec # echo=echo if mkdir _sh12320; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' exit 1 fi # ============= FGLDOC-2.00 ============== $echo 'x -' extracting 'FGLDOC-2.00' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'FGLDOC-2.00' && XDON'T REMOVE THIS FILE, the configure script uses it. SHAR_EOF chmod 0644 'FGLDOC-2.00' || $echo 'restore of' 'FGLDOC-2.00' 'failed' # ============= Makefile.in ============== $echo 'x -' extracting 'Makefile.in' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'Makefile.in' && X X# Standard programs/flags/libraries. X# XCC = @CC@ XCFLAGS = @CFLAGS@ XLDFLAGS = @LDFLAGS@ XYACC = @YACC@ XYFLAGS = @YFLAGS@ XLEX = @LEX@ XLFLAGS = @LFLAGS@ XINSTALL = @INSTALL@ XLIBS = @LIBS@ X X# Installation paths. X# Xinstall_top = Xprefix = @prefix@ Xexec_prefix = @exec_prefix@ Xbindir = @bindir@ Xmandir = @mandir@ X X# ESQL/C setup, ignored if the program is made without ESQL/C. X# XESQL = @ESQL@ XESQLFLAGS = @ESQLFLAGS@ X X# A little shell game for compiling with or without ESQL/C. The idea X# is to avoid Makefile conditionals. X# XPROGRAM = fgldoc XTARGET = @target@ XECOBJS = @ecobjs@ X X# Object files. XOBJS = fgldoc.o parser.o lexer.o $(ECOBJS) X X# The configure script will define the proper default target. Xall: $(PROGRAM) X X$(PROGRAM): $(OBJS) X if test $(TARGET) = fgldoc; then \ X $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS); \ X else \ X $(ESQL) $(ESQLFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LIBS); \ X fi X Xread_pdbs.o: read_pdbs.ec config.h X if test -n "$$INFORMIXC"; then \ X $(ESQL) $(ESQLFLAGS) -c read_pdbs.ec; \ X else \ X $(ESQL) $(ESQLFLAGS) $(CFLAGS) -c read_pdbs.ec; \ X fi X rm -f read_pdbs.c X Xinstall: install-bin install-man X Xinstall-bin: $(PROGRAM) X $(INSTALL) -d $(install_top)$(bindir) X $(INSTALL) -o root -g root -m 755 $(PROGRAM) $(install_top)$(bindir) X Xinstall-man: $(PROGRAM).1 X $(INSTALL) -d $(install_top)$(mandir)/man1 X $(INSTALL) -o root -g root -m 644 $(PROGRAM).1 $(install_top)$(mandir)/man1 X Xfgldoc.o: fgldoc.c fgldoc.h config.h X Xlexer.o: lexer.l y.tab.h config.h X Xparser.o: parser.y fgldoc.h config.h X Xy.tab.h: parser.y X Xclean: X rm -f $(PROGRAM) $(OBJS) core y.tab.h X Xdistclean: clean X rm -f Makefile config.h config.status config.cache config.log SHAR_EOF chmod 0644 'Makefile.in' || $echo 'restore of' 'Makefile.in' 'failed' # ============= README ============== $echo 'x -' extracting 'README' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'README' && XIntroduction X============ X XThis is version 2.00 of fgldoc, a documenter for Informix-4GL programs. XSee the "Installation" section of this file for building and installation Xinstructions. The program is documented in the manual page "fgldoc.1"; a Xpreformatted version is included as "fgldoc.txt". X X XRequirements X============ X X1. An ANSI C compiler. X X2. ESQL/C or Informix-4GL (C compiled, not RDS), if you want the ability to X access the program design database directly. Any version from 4.00 X onwards should work. Be warned that connections are implicit and use X your current credentials; CONNECT TO... USER... USING is not implemented. X XPoint #2 implies having proper development and run-time licenses for the Xmachine(s) where you build and run fgldoc. The term "proper" doesn't even Xbegin to describe all the variations and nuances that could exist; for a Xreasonably detailed (and certainly more authoritative) discussion of the Xmatter, consult the file "Informix.License" from the DBD::Informix Xdistribution, available at any CPAN site (a Perl module repository, start Xfrom http://www.perl.org if you don't know how to find one). That said, in Xthe anticipated case of running fgldoc on the same machine where it was Xcompiled it is probably OK to use the locally installed ESQL/C software Xfor building the program. X X XInstallation X============ X XIf you have a working ESQL/C or Informix-4GL setup and want to use it with Xfgldoc, make sure that INFORMIXDIR is set and $INFORMIXDIR/bin is in $PATH, Xand start the "configure" script with X X ./configure X XThe script will make a number of checks and, if all is well, generate X"Makefile" and "config.h". To build fgldoc, type "make"; after that, type X"make install" to install the program and the manual page, or copy them to Xa suitable directory by hand. X XThose who don't have ESQL/C or do not wish to use it should specify the X"--without-esqlc" argument with "configure", like so: X X ./configure --without-esqlc X XBuilding and installation steps are the same. X XN.B. If the INFORMIXC environment variable is set, the "configure" script Xand the Makefile will NOT pass the value of CFLAGS to esql. X X XCopyright and License X===================== X XCopyright (c) 1995-1999 Ivan Nejgebauer X XThis program is free software released under the GNU General Public XLicense. If built with software components provided by Informix Software XInc., the compiled program can only be used and distributed subject to Xrestrictions imposed by your licensing agreement with Informix. SHAR_EOF chmod 0644 'README' || $echo 'restore of' 'README' 'failed' # ============= aclocal.m4 ============== $echo 'x -' extracting 'aclocal.m4' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'aclocal.m4' && Xdnl This file is in the public domain. X Xdnl Checks for $INFORMIXDIR and $INFORMIXDIR/bin in $PATH. Xdnl People who add trailing slashes to the directories in $PATH will suffer. XAC_DEFUN(AC_INFORMIX_ENV, X[AC_MSG_CHECKING([whether the Informix environment looks sane]) Xif test "x$INFORMIXDIR" != x && test -d "$INFORMIXDIR"; then X ac_junk_ixp=no X for ac_junk in `echo "$PATH" | sed 's/:/ /g'`; do X if test "$ac_junk" = "$INFORMIXDIR/bin"; then X ac_junk_ixp=yes X break X fi X done X if test "$ac_junk_ixp" = yes; then X AC_MSG_RESULT(yes) X else X AC_MSG_RESULT(no) X AC_MSG_ERROR([\$INFORMIXDIR/bin not in \$PATH]) X fi Xelse X AC_MSG_RESULT(no) X AC_MSG_ERROR([\$INFORMIXDIR not set or not a directory]) Xfi]) X Xdnl ESQL/C AC_LANG definition. XAC_DEFUN(AC_LANG_ESQLC, X[define([AC_LANG], [ESQLC])dnl Xac_ext=ec Xif test -n "$INFORMIXC"; then X ac_link='${ESQL-esql} $ESQLFLAGS -o conftest $LDFLAGS conftest.$ac_ext 1>&AC_FD_CC' Xelse X ac_link='${ESQL-esql} $ESQLFLAGS $CFLAGS -o conftest $LDFLAGS conftest.$ac_ext 1>&AC_FD_CC' Xfi X]) X Xdnl Checks whether the ESQL/C preprocessor works. XAC_DEFUN(AC_PROG_ESQL_WORKS, X[if test ! -n "$INFORMIXC"; then X ac_junk_cflags="$CFLAGS" Xfi XAC_MSG_CHECKING([whether the ESQL/C preprocessor (${ESQL}${ESQLFLAGS+ $ESQLFLAGS}${ac_junk_cflags+ $ac_junk_cflags}${LDFLAGS+ $LDFLAGS}) works]) XAC_LANG_SAVE XAC_LANG_ESQLC XAC_TRY_COMPILER([main(){ XEXEC SQL close database; X}], ac_cv_prog_esql_works, ac_junk) XAC_LANG_RESTORE XAC_MSG_RESULT($ac_cv_prog_esql_works) Xif test $ac_cv_prog_esql_works = no; then X AC_MSG_ERROR([installation or configuration problem with ESQL/C]) Xfi X]) X Xdnl Determines the ESQL/C version. XAC_DEFUN(AC_PROG_ESQLC_VERSION, X[AC_CACHE_CHECK(${ESQL-esql} version, ac_cv_prog_esqlc_version, X[ac_junk=`${ESQL-esql} -V 2>/dev/null | Xchangequote(, )dnl X sed -e 's/[ ]*$//' -e 's/.* \([^ ]*\)$/\1/' -e 1q` Xchangequote([, ])dnl Xif test "x$ac_junk" != x; then X ac_cv_prog_esqlc_version=$ac_junk Xelse X ac_cv_prog_esqlc_version="0.00.AA0" Xfi])]) X Xdnl Checks for rgetlmsg(). XAC_DEFUN(AC_FUNC_RGETLMSG, X[AC_LANG_SAVE XAC_LANG_ESQLC Xac_ext=c Xdnl That was gross, but we don't want esql to insert any #include's Xdnl with true prototypes. XAC_CHECK_FUNC(rgetlmsg, AC_DEFINE(HAVE_RGETLMSG)) XAC_LANG_RESTORE X]) X Xdnl Checks for an ESQL/C preprocessor. XAC_DEFUN(AC_PROG_ESQL, X[AC_CHECK_PROG(ESQL, esql, esql) Xif test -z "$ESQL"; then X AC_CHECK_PROG(ESQL, c4gl, c4gl) X test -z "$ESQL" && AC_MSG_ERROR([no ESQL/C preprocessor found in \$PATH]) Xfi XAC_PROG_ESQLC_VERSION XAC_PROG_ESQL_WORKS X]) SHAR_EOF chmod 0644 'aclocal.m4' || $echo 'restore of' 'aclocal.m4' 'failed' # ============= config.h.in ============== $echo 'x -' extracting 'config.h.in' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'config.h.in' && X X/* Define to empty if the keyword does not work. */ X#undef const X X/* Define if using ESQL/C. */ X#undef HAVE_ESQLC X X/* Define if there is a rgetlmsg() function in the 4GL library. */ X#undef HAVE_RGETLMSG SHAR_EOF chmod 0644 'config.h.in' || $echo 'restore of' 'config.h.in' 'failed' # ============= configure ============== $echo 'x -' extracting 'configure' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'configure' && X#! /bin/sh X X# Guess values for system-dependent variables and create Makefiles. X# Generated automatically using autoconf version 2.12 X# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. X# X# This configure script is free software; the Free Software Foundation X# gives unlimited permission to copy, distribute and modify it. X X# Defaults: Xac_help= Xac_default_prefix=/usr/local X# Any additions from configure.in: Xac_help="$ac_help X --without-esqlc do not use ESQL/C" X X# Initialize some variables set by options. X# The variables have the same names as the options, with X# dashes changed to underlines. Xbuild=NONE Xcache_file=./config.cache Xexec_prefix=NONE Xhost=NONE Xno_create= Xnonopt=NONE Xno_recursion= Xprefix=NONE Xprogram_prefix=NONE Xprogram_suffix=NONE Xprogram_transform_name=s,x,x, Xsilent= Xsite= Xsrcdir= Xtarget=NONE Xverbose= Xx_includes=NONE Xx_libraries=NONE Xbindir='${exec_prefix}/bin' Xsbindir='${exec_prefix}/sbin' Xlibexecdir='${exec_prefix}/libexec' Xdatadir='${prefix}/share' Xsysconfdir='${prefix}/etc' Xsharedstatedir='${prefix}/com' Xlocalstatedir='${prefix}/var' Xlibdir='${exec_prefix}/lib' Xincludedir='${prefix}/include' Xoldincludedir='/usr/include' Xinfodir='${prefix}/info' Xmandir='${prefix}/man' X X# Initialize some other variables. Xsubdirs= XMFLAGS= MAKEFLAGS= X# Maximum number of lines to put in a shell here document. Xac_max_here_lines=12 X Xac_prev= Xfor ac_option Xdo X X # If the previous option needs an argument, assign it. X if test -n "$ac_prev"; then X eval "$ac_prev=\$ac_option" X ac_prev= X continue X fi X X case "$ac_option" in X -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; X *) ac_optarg= ;; X esac X X # Accept the important Cygnus configure options, so we can diagnose typos. X X case "$ac_option" in X X -bindir | --bindir | --bindi | --bind | --bin | --bi) X ac_prev=bindir ;; X -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) X bindir="$ac_optarg" ;; X X -build | --build | --buil | --bui | --bu) X ac_prev=build ;; X -build=* | --build=* | --buil=* | --bui=* | --bu=*) X build="$ac_optarg" ;; X X -cache-file | --cache-file | --cache-fil | --cache-fi \ X | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) X ac_prev=cache_file ;; X -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ X | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) X cache_file="$ac_optarg" ;; X X -datadir | --datadir | --datadi | --datad | --data | --dat | --da) X ac_prev=datadir ;; X -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ X | --da=*) X datadir="$ac_optarg" ;; X X -disable-* | --disable-*) X ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then X { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } X fi X ac_feature=`echo $ac_feature| sed 's/-/_/g'` X eval "enable_${ac_feature}=no" ;; X X -enable-* | --enable-*) X ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then X { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } X fi X ac_feature=`echo $ac_feature| sed 's/-/_/g'` X case "$ac_option" in X *=*) ;; X *) ac_optarg=yes ;; X esac X eval "enable_${ac_feature}='$ac_optarg'" ;; X X -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ X | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ X | --exec | --exe | --ex) X ac_prev=exec_prefix ;; X -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ X | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ X | --exec=* | --exe=* | --ex=*) X exec_prefix="$ac_optarg" ;; X X -gas | --gas | --ga | --g) X # Obsolete; use --with-gas. X with_gas=yes ;; X X -help | --help | --hel | --he) X # Omit some internal or obsolete options to make the list less imposing. X # This message is too long to be a string in the A/UX 3.1 sh. X cat << EOF XUsage: configure [options] [host] XOptions: [defaults in brackets after descriptions] XConfiguration: X --cache-file=FILE cache test results in FILE X --help print this message X --no-create do not create output files X --quiet, --silent do not print \`checking...' messages X --version print the version of autoconf that created configure XDirectory and file names: X --prefix=PREFIX install architecture-independent files in PREFIX X [$ac_default_prefix] X --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX X [same as prefix] X --bindir=DIR user executables in DIR [EPREFIX/bin] X --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] X --libexecdir=DIR program executables in DIR [EPREFIX/libexec] X --datadir=DIR read-only architecture-independent data in DIR X [PREFIX/share] X --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] X --sharedstatedir=DIR modifiable architecture-independent data in DIR X [PREFIX/com] X --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] X --libdir=DIR object code libraries in DIR [EPREFIX/lib] X --includedir=DIR C header files in DIR [PREFIX/include] X --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] X --infodir=DIR info documentation in DIR [PREFIX/info] X --mandir=DIR man documentation in DIR [PREFIX/man] X --srcdir=DIR find the sources in DIR [configure dir or ..] X --program-prefix=PREFIX prepend PREFIX to installed program names X --program-suffix=SUFFIX append SUFFIX to installed program names X --program-transform-name=PROGRAM X run sed PROGRAM on installed program names XEOF X cat << EOF XHost type: X --build=BUILD configure for building on BUILD [BUILD=HOST] X --host=HOST configure for HOST [guessed] X --target=TARGET configure for TARGET [TARGET=HOST] XFeatures and packages: X --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) X --enable-FEATURE[=ARG] include FEATURE [ARG=yes] X --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] X --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) X --x-includes=DIR X include files are in DIR X --x-libraries=DIR X library files are in DIR XEOF X if test -n "$ac_help"; then X echo "--enable and --with options recognized:$ac_help" X fi X exit 0 ;; X X -host | --host | --hos | --ho) X ac_prev=host ;; X -host=* | --host=* | --hos=* | --ho=*) X host="$ac_optarg" ;; X X -includedir | --includedir | --includedi | --included | --include \ X | --includ | --inclu | --incl | --inc) X ac_prev=includedir ;; X -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ X | --includ=* | --inclu=* | --incl=* | --inc=*) X includedir="$ac_optarg" ;; X X -infodir | --infodir | --infodi | --infod | --info | --inf) X ac_prev=infodir ;; X -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) X infodir="$ac_optarg" ;; X X -libdir | --libdir | --libdi | --libd) X ac_prev=libdir ;; X -libdir=* | --libdir=* | --libdi=* | --libd=*) X libdir="$ac_optarg" ;; X X -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ X | --libexe | --libex | --libe) X ac_prev=libexecdir ;; X -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ X | --libexe=* | --libex=* | --libe=*) X libexecdir="$ac_optarg" ;; X X -localstatedir | --localstatedir | --localstatedi | --localstated \ X | --localstate | --localstat | --localsta | --localst \ X | --locals | --local | --loca | --loc | --lo) X ac_prev=localstatedir ;; X -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ X | --localstate=* | --localstat=* | --localsta=* | --localst=* \ X | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) X localstatedir="$ac_optarg" ;; X X -mandir | --mandir | --mandi | --mand | --man | --ma | --m) X ac_prev=mandir ;; X -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) X mandir="$ac_optarg" ;; X X -nfp | --nfp | --nf) X # Obsolete; use --without-fp. X with_fp=no ;; X X -no-create | --no-create | --no-creat | --no-crea | --no-cre \ X | --no-cr | --no-c) X no_create=yes ;; X X -no-recursion | --no-recursion | --no-recursio | --no-recursi \ X | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) X no_recursion=yes ;; X X -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ X | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ X | --oldin | --oldi | --old | --ol | --o) X ac_prev=oldincludedir ;; X -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ X | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ X | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) X oldincludedir="$ac_optarg" ;; X X -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) X ac_prev=prefix ;; X -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) X prefix="$ac_optarg" ;; X X -program-prefix | --program-prefix | --program-prefi | --program-pref \ X | --program-pre | --program-pr | --program-p) X ac_prev=program_prefix ;; X -program-prefix=* | --program-prefix=* | --program-prefi=* \ X | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) X program_prefix="$ac_optarg" ;; X X -program-suffix | --program-suffix | --program-suffi | --program-suff \ X | --program-suf | --program-su | --program-s) X ac_prev=program_suffix ;; X -program-suffix=* | --program-suffix=* | --program-suffi=* \ X | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) X program_suffix="$ac_optarg" ;; X X -program-transform-name | --program-transform-name \ X | --program-transform-nam | --program-transform-na \ X | --program-transform-n | --program-transform- \ X | --program-transform | --program-transfor \ X | --program-transfo | --program-transf \ X | --program-trans | --program-tran \ X | --progr-tra | --program-tr | --program-t) X ac_prev=program_transform_name ;; X -program-transform-name=* | --program-transform-name=* \ X | --program-transform-nam=* | --program-transform-na=* \ X | --program-transform-n=* | --program-transform-=* \ X | --program-transform=* | --program-transfor=* \ X | --program-transfo=* | --program-transf=* \ X | --program-trans=* | --program-tran=* \ X | --progr-tra=* | --program-tr=* | --program-t=*) X program_transform_name="$ac_optarg" ;; X X -q | -quiet | --quiet | --quie | --qui | --qu | --q \ X | -silent | --silent | --silen | --sile | --sil) X silent=yes ;; X X -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) X ac_prev=sbindir ;; X -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ X | --sbi=* | --sb=*) X sbindir="$ac_optarg" ;; X X -sharedstatedir | --sharedstatedir | --sharedstatedi \ X | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ X | --sharedst | --shareds | --shared | --share | --shar \ X | --sha | --sh) X ac_prev=sharedstatedir ;; X -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ X | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ X | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ X | --sha=* | --sh=*) X sharedstatedir="$ac_optarg" ;; X X -site | --site | --sit) X ac_prev=site ;; X -site=* | --site=* | --sit=*) X site="$ac_optarg" ;; X X -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) X ac_prev=srcdir ;; X -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) X srcdir="$ac_optarg" ;; X X -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ X | --syscon | --sysco | --sysc | --sys | --sy) X ac_prev=sysconfdir ;; X -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ X | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) X sysconfdir="$ac_optarg" ;; X X -target | --target | --targe | --targ | --tar | --ta | --t) X ac_prev=target ;; X -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) X target="$ac_optarg" ;; X X -v | -verbose | --verbose | --verbos | --verbo | --verb) X verbose=yes ;; X X -version | --version | --versio | --versi | --vers) X echo "configure generated by autoconf version 2.12" X exit 0 ;; X X -with-* | --with-*) X ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then X { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } X fi X ac_package=`echo $ac_package| sed 's/-/_/g'` X case "$ac_option" in X *=*) ;; X *) ac_optarg=yes ;; X esac X eval "with_${ac_package}='$ac_optarg'" ;; X X -without-* | --without-*) X ac_package=`echo $ac_option|sed -e 's/-*without-//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then X { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } X fi X ac_package=`echo $ac_package| sed 's/-/_/g'` X eval "with_${ac_package}=no" ;; X X --x) X # Obsolete; use --with-x. X with_x=yes ;; X X -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ X | --x-incl | --x-inc | --x-in | --x-i) X ac_prev=x_includes ;; X -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ X | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) X x_includes="$ac_optarg" ;; X X -x-libraries | --x-libraries | --x-librarie | --x-librari \ X | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) X ac_prev=x_libraries ;; X -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ X | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) X x_libraries="$ac_optarg" ;; X X -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } X ;; X X *) X if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then X echo "configure: warning: $ac_option: invalid host type" 1>&2 X fi X if test "x$nonopt" != xNONE; then X { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } X fi X nonopt="$ac_option" X ;; X X esac Xdone X Xif test -n "$ac_prev"; then X { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } Xfi X Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 X X# File descriptor usage: X# 0 standard input X# 1 file creation X# 2 errors and warnings X# 3 some systems may open it to /dev/tty X# 4 used on the Kubota Titan X# 6 checking for... messages and results X# 5 compiler messages saved in config.log Xif test "$silent" = yes; then X exec 6>/dev/null Xelse X exec 6>&1 Xfi Xexec 5>./config.log X Xecho "\ XThis file contains any messages produced by compilers while Xrunning configure, to aid debugging if configure makes a mistake. X" 1>&5 X X# Strip out --no-create and --no-recursion so they do not pile up. X# Also quote any args containing shell metacharacters. Xac_configure_args= Xfor ac_arg Xdo X case "$ac_arg" in X -no-create | --no-create | --no-creat | --no-crea | --no-cre \ X | --no-cr | --no-c) ;; X -no-recursion | --no-recursion | --no-recursio | --no-recursi \ X | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; X *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) X ac_configure_args="$ac_configure_args '$ac_arg'" ;; X *) ac_configure_args="$ac_configure_args $ac_arg" ;; X esac Xdone X X# NLS nuisances. X# Only set these to C if already set. These must not be set unconditionally X# because not all systems understand e.g. LANG=C (notably SCO). X# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! X# Non-C LC_CTYPE values break the ctype check. Xif test "${LANG+set}" = set; then LANG=C; export LANG; fi Xif test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi Xif test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi Xif test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi X X# confdefs.h avoids OS command line length limits that DEFS can exceed. Xrm -rf conftest* confdefs.h X# AIX cpp loses on an empty file, so make sure it contains at least a newline. Xecho > confdefs.h X X# A filename unique to this package, relative to the directory that X# configure is in, which we can look for to find out if srcdir is correct. Xac_unique_file=FGLDOC-2.00 X X# Find the source files, if location was not specified. Xif test -z "$srcdir"; then X ac_srcdir_defaulted=yes X # Try the directory containing this script, then its parent. X ac_prog=$0 X ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` X test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. X srcdir=$ac_confdir X if test ! -r $srcdir/$ac_unique_file; then X srcdir=.. X fi Xelse X ac_srcdir_defaulted=no Xfi Xif test ! -r $srcdir/$ac_unique_file; then X if test "$ac_srcdir_defaulted" = yes; then X { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } X else X { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } X fi Xfi Xsrcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` X X# Prefer explicitly selected file to automatically selected ones. Xif test -z "$CONFIG_SITE"; then X if test "x$prefix" != xNONE; then X CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" X else X CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" X fi Xfi Xfor ac_site_file in $CONFIG_SITE; do X if test -r "$ac_site_file"; then X echo "loading site script $ac_site_file" X . "$ac_site_file" X fi Xdone X Xif test -r "$cache_file"; then X echo "loading cache $cache_file" X . $cache_file Xelse X echo "creating cache $cache_file" X > $cache_file Xfi X Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross X Xif (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then X # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. X if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then X ac_n= ac_c=' X' ac_t=' ' X else X ac_n=-n ac_c= ac_t= X fi Xelse X ac_n= ac_c='\c' ac_t= Xfi X X X X X# Extract the first word of "gcc", so it can be a program name with args. Xset dummy gcc; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:529: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$CC"; then X ac_cv_prog_CC="$CC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" X for ac_dir in $PATH; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_CC="gcc" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XCC="$ac_cv_prog_CC" Xif test -n "$CC"; then X echo "$ac_t""$CC" 1>&6 Xelse X echo "$ac_t""no" 1>&6 Xfi X Xif test -z "$CC"; then X # Extract the first word of "cc", so it can be a program name with args. Xset dummy cc; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:558: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$CC"; then X ac_cv_prog_CC="$CC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" X ac_prog_rejected=no X for ac_dir in $PATH; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then X ac_prog_rejected=yes X continue X fi X ac_cv_prog_CC="cc" X break X fi X done X IFS="$ac_save_ifs" Xif test $ac_prog_rejected = yes; then X # We found a bogon in the path, so make sure we never use it. X set dummy $ac_cv_prog_CC X shift X if test $# -gt 0; then X # We chose a different compiler from the bogus one. X # However, it has the same basename, so the bogon will be chosen X # first if we set CC to just the basename; use the full file name. X shift X set dummy "$ac_dir/$ac_word" "$@" X shift X ac_cv_prog_CC="$@" X fi Xfi Xfi Xfi XCC="$ac_cv_prog_CC" Xif test -n "$CC"; then X echo "$ac_t""$CC" 1>&6 Xelse X echo "$ac_t""no" 1>&6 Xfi X X test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } Xfi X Xecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 Xecho "configure:606: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 X Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross X Xcat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then X ac_cv_prog_cc_works=yes X # If we can't run a trivial program, we are probably using a cross compiler. X if (./conftest; exit) 2>/dev/null; then X ac_cv_prog_cc_cross=no X else X ac_cv_prog_cc_cross=yes X fi Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X ac_cv_prog_cc_works=no Xfi Xrm -fr conftest* X Xecho "$ac_t""$ac_cv_prog_cc_works" 1>&6 Xif test $ac_cv_prog_cc_works = no; then X { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } Xfi Xecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 Xecho "configure:640: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 Xecho "$ac_t""$ac_cv_prog_cc_cross" 1>&6 Xcross_compiling=$ac_cv_prog_cc_cross X Xecho $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 Xecho "configure:645: checking whether we are using GNU C" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then X ac_cv_prog_gcc=yes Xelse X ac_cv_prog_gcc=no Xfi Xfi X Xecho "$ac_t""$ac_cv_prog_gcc" 1>&6 X Xif test $ac_cv_prog_gcc = yes; then X GCC=yes X ac_test_CFLAGS="${CFLAGS+set}" X ac_save_CFLAGS="$CFLAGS" X CFLAGS= X echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 Xecho "configure:669: checking whether ${CC-cc} accepts -g" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X echo 'void f(){}' > conftest.c Xif test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then X ac_cv_prog_cc_g=yes Xelse X ac_cv_prog_cc_g=no Xfi Xrm -f conftest* X Xfi X Xecho "$ac_t""$ac_cv_prog_cc_g" 1>&6 X if test "$ac_test_CFLAGS" = set; then X CFLAGS="$ac_save_CFLAGS" X elif test $ac_cv_prog_cc_g = yes; then X CFLAGS="-g -O2" X else X CFLAGS="-O2" X fi Xelse X GCC= X test "${CFLAGS+set}" = set || CFLAGS="-g" Xfi X Xfor ac_prog in 'bison -y' byacc Xdo X# Extract the first word of "$ac_prog", so it can be a program name with args. Xset dummy $ac_prog; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:701: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$YACC"; then X ac_cv_prog_YACC="$YACC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" X for ac_dir in $PATH; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_YACC="$ac_prog" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XYACC="$ac_cv_prog_YACC" Xif test -n "$YACC"; then X echo "$ac_t""$YACC" 1>&6 Xelse X echo "$ac_t""no" 1>&6 Xfi X Xtest -n "$YACC" && break Xdone Xtest -n "$YACC" || YACC="yacc" X X# Extract the first word of "flex", so it can be a program name with args. Xset dummy flex; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:733: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$LEX"; then X ac_cv_prog_LEX="$LEX" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" X for ac_dir in $PATH; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_LEX="flex" X break X fi X done X IFS="$ac_save_ifs" X test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" Xfi Xfi XLEX="$ac_cv_prog_LEX" Xif test -n "$LEX"; then X echo "$ac_t""$LEX" 1>&6 Xelse X echo "$ac_t""no" 1>&6 Xfi X Xif test -z "$LEXLIB" Xthen X case "$LEX" in X flex*) ac_lib=fl ;; X *) ac_lib=l ;; X esac X echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 Xecho "configure:766: checking for yywrap in -l$ac_lib" >&5 Xac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS="-l$ac_lib $LIBS" Xcat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X echo "$ac_t""yes" 1>&6 X LEXLIB="-l$ac_lib" Xelse X echo "$ac_t""no" 1>&6 Xfi X Xfi X Xac_aux_dir= Xfor ac_dir in $srcdir $srcdir/.. $srcdir/../..; do X if test -f $ac_dir/install-sh; then X ac_aux_dir=$ac_dir X ac_install_sh="$ac_aux_dir/install-sh -c" X break X elif test -f $ac_dir/install.sh; then X ac_aux_dir=$ac_dir X ac_install_sh="$ac_aux_dir/install.sh -c" X break X fi Xdone Xif test -z "$ac_aux_dir"; then X { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } Xfi Xac_config_guess=$ac_aux_dir/config.guess Xac_config_sub=$ac_aux_dir/config.sub Xac_configure=$ac_aux_dir/configure # This should be Cygnus configure. X X# Find a good install program. We prefer a C program (faster), X# so one script is as good as another. But avoid the broken or X# incompatible versions: X# SysV /etc/install, /usr/sbin/install X# SunOS /usr/etc/install X# IRIX /sbin/install X# AIX /bin/install X# AFS /usr/afsws/bin/install, which mishandles nonexistent args X# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" X# ./install, which can be erroneously created by make from ./install.sh. Xecho $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 Xecho "configure:837: checking for a BSD compatible install" >&5 Xif test -z "$INSTALL"; then Xif eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" X for ac_dir in $PATH; do X # Account for people who put trailing slashes in PATH elements. X case "$ac_dir/" in X /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; X *) X # OSF1 and SCO ODT 3.0 have their own names for install. X for ac_prog in ginstall installbsd scoinst install; do X if test -f $ac_dir/$ac_prog; then X if test $ac_prog = install && X grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then X # AIX install. It has an incompatible calling convention. X # OSF/1 installbsd also uses dspmsg, but is usable. X : X else X ac_cv_path_install="$ac_dir/$ac_prog -c" X break 2 X fi X fi X done X ;; X esac X done X IFS="$ac_save_IFS" X Xfi X if test "${ac_cv_path_install+set}" = set; then X INSTALL="$ac_cv_path_install" X else X # As a last resort, use the slow shell script. We don't cache a X # path for INSTALL within a source directory, because that will X # break other packages using the cache if that directory is X # removed, or if the path is relative. X INSTALL="$ac_install_sh" X fi Xfi Xecho "$ac_t""$INSTALL" 1>&6 X X# Use test -z because SunOS4 sh mishandles braces in ${var-val}. X# It thinks the first close brace ends the variable substitution. Xtest -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' X Xtest -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' X X Xecho $ac_n "checking for working const""... $ac_c" 1>&6 Xecho "configure:888: checking for working const" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <j = 5; X} X{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ X const int foo = 10; X} X X; return 0; } XEOF Xif { (eval echo configure:942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then X rm -rf conftest* X ac_cv_c_const=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_c_const=no Xfi Xrm -f conftest* Xfi X Xecho "$ac_t""$ac_cv_c_const" 1>&6 Xif test $ac_cv_c_const = no; then X cat >> confdefs.h <<\EOF X#define const XEOF X Xfi X X X# Check whether --with-esqlc or --without-esqlc was given. Xif test "${with_esqlc+set}" = set; then X withval="$with_esqlc" X if test "$withval" = no; then X use_esqlc=no X else X use_esqlc="$withval" X fi Xfi X X Xif test "$use_esqlc" != no; then X echo $ac_n "checking whether the Informix environment looks sane""... $ac_c" 1>&6 Xecho "configure:976: checking whether the Informix environment looks sane" >&5 Xif test "x$INFORMIXDIR" != x && test -d "$INFORMIXDIR"; then X ac_junk_ixp=no X for ac_junk in `echo "$PATH" | sed 's/:/ /g'`; do X if test "$ac_junk" = "$INFORMIXDIR/bin"; then X ac_junk_ixp=yes X break X fi X done X if test "$ac_junk_ixp" = yes; then X echo "$ac_t""yes" 1>&6 X else X echo "$ac_t""no" 1>&6 X { echo "configure: error: \$INFORMIXDIR/bin not in \$PATH" 1>&2; exit 1; } X fi Xelse X echo "$ac_t""no" 1>&6 X { echo "configure: error: \$INFORMIXDIR not set or not a directory" 1>&2; exit 1; } Xfi X # Extract the first word of "esql", so it can be a program name with args. Xset dummy esql; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:998: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_ESQL'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$ESQL"; then X ac_cv_prog_ESQL="$ESQL" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" X for ac_dir in $PATH; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_ESQL="esql" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XESQL="$ac_cv_prog_ESQL" Xif test -n "$ESQL"; then X echo "$ac_t""$ESQL" 1>&6 Xelse X echo "$ac_t""no" 1>&6 Xfi X Xif test -z "$ESQL"; then X # Extract the first word of "c4gl", so it can be a program name with args. Xset dummy c4gl; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1027: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_ESQL'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$ESQL"; then X ac_cv_prog_ESQL="$ESQL" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" X for ac_dir in $PATH; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_ESQL="c4gl" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XESQL="$ac_cv_prog_ESQL" Xif test -n "$ESQL"; then X echo "$ac_t""$ESQL" 1>&6 Xelse X echo "$ac_t""no" 1>&6 Xfi X X test -z "$ESQL" && { echo "configure: error: no ESQL/C preprocessor found in \$PATH" 1>&2; exit 1; } Xfi Xecho $ac_n "checking ${ESQL-esql} version""... $ac_c" 1>&6 Xecho "configure:1055: checking ${ESQL-esql} version" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_esqlc_version'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_junk=`${ESQL-esql} -V 2>/dev/null | X sed -e 's/[ ]*$//' -e 's/.* \([^ ]*\)$/\1/' -e 1q` Xif test "x$ac_junk" != x; then X ac_cv_prog_esqlc_version=$ac_junk Xelse X ac_cv_prog_esqlc_version="0.00.AA0" Xfi Xfi X Xecho "$ac_t""$ac_cv_prog_esqlc_version" 1>&6 Xif test ! -n "$INFORMIXC"; then X ac_junk_cflags="$CFLAGS" Xfi Xecho $ac_n "checking whether the ESQL/C preprocessor (${ESQL}${ESQLFLAGS+ $ESQLFLAGS}${ac_junk_cflags+ $ac_junk_cflags}${LDFLAGS+ $LDFLAGS}) works""... $ac_c" 1>&6 Xecho "configure:1073: checking whether the ESQL/C preprocessor (${ESQL}${ESQLFLAGS+ $ESQLFLAGS}${ac_junk_cflags+ $ac_junk_cflags}${LDFLAGS+ $LDFLAGS}) works" >&5 X Xac_ext=ec Xif test -n "$INFORMIXC"; then X ac_link='${ESQL-esql} $ESQLFLAGS -o conftest $LDFLAGS conftest.$ac_ext 1>&5' Xelse X ac_link='${ESQL-esql} $ESQLFLAGS $CFLAGS -o conftest $LDFLAGS conftest.$ac_ext 1>&5' Xfi X Xcat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then X ac_cv_prog_esql_works=yes X # If we can't run a trivial program, we are probably using a cross compiler. X if (./conftest; exit) 2>/dev/null; then X ac_junk=no X else X ac_junk=yes X fi Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X ac_cv_prog_esql_works=no Xfi Xrm -fr conftest* Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross X Xecho "$ac_t""$ac_cv_prog_esql_works" 1>&6 Xif test $ac_cv_prog_esql_works = no; then X { echo "configure: error: installation or configuration problem with ESQL/C" 1>&2; exit 1; } Xfi X X X Xac_ext=ec Xif test -n "$INFORMIXC"; then X ac_link='${ESQL-esql} $ESQLFLAGS -o conftest $LDFLAGS conftest.$ac_ext 1>&5' Xelse X ac_link='${ESQL-esql} $ESQLFLAGS $CFLAGS -o conftest $LDFLAGS conftest.$ac_ext 1>&5' Xfi X Xac_ext=c Xecho $ac_n "checking for rgetlmsg""... $ac_c" 1>&6 Xecho "configure:1126: checking for rgetlmsg" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_rgetlmsg'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar rgetlmsg(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_rgetlmsg) || defined (__stub___rgetlmsg) Xchoke me X#else Xrgetlmsg(); X#endif X X; return 0; } XEOF Xif { (eval echo configure:1154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then X rm -rf conftest* X eval "ac_cv_func_rgetlmsg=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_rgetlmsg=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'rgetlmsg`\" = yes"; then X echo "$ac_t""yes" 1>&6 X cat >> confdefs.h <<\EOF X#define HAVE_RGETLMSG 1 XEOF X Xelse X echo "$ac_t""no" 1>&6 Xfi X Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross X X X cat >> confdefs.h <<\EOF X#define HAVE_ESQLC 1 XEOF X X ecobjs=read_pdbs.o X target=fgldoc-ec Xelse X ecobjs="" X target=fgldoc Xfi X X X Xif test "x$YFLAGS" = x; then X YFLAGS=-d Xfi Xif test "x$LFLAGS" = x; then X LFLAGS="" Xfi X X X XLIBS="$LIBS $LEXLIB" X X X Xtrap '' 1 2 15 Xcat > confcache <<\EOF X# This file is a shell script that caches the results of configure X# tests run on this system so they can be shared between configure X# scripts and configure runs. It is not useful on other systems. X# If it contains results you don't want to keep, you may remove or edit it. X# X# By default, configure uses ./config.cache as the cache file, X# creating it if it does not exist already. You can give configure X# the --cache-file=FILE option to use a different cache file; that is X# what configure does when it calls configure scripts in X# subdirectories, so they share the cache. X# Giving --cache-file=/dev/null disables caching, for debugging configure. X# config.status only pays attention to the cache file if you give it the X# --recheck option to rerun configure. X# XEOF X# The following way of writing the cache mishandles newlines in values, X# but we know of no workaround that is simple, portable, and efficient. X# So, don't put newlines in cache variables' values. X# Ultrix sh set writes to stderr and can't be redirected directly, X# and sets the high bit in the cache file unless we assign to the vars. X(set) 2>&1 | X case `(ac_space=' '; set) 2>&1` in X *ac_space=\ *) X # `set' does not quote correctly, so add quotes (double-quote substitution X # turns \\\\ into \\, and sed turns \\ into \). X sed -n \ X -e "s/'/'\\\\''/g" \ X -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" X ;; X *) X # `set' quotes correctly as required by POSIX, so do not add quotes. X sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' X ;; X esac >> confcache Xif cmp -s $cache_file confcache; then X : Xelse X if test -w $cache_file; then X echo "updating cache $cache_file" X cat confcache > $cache_file X else X echo "not updating unwritable cache $cache_file" X fi Xfi Xrm -f confcache X Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 X Xtest "x$prefix" = xNONE && prefix=$ac_default_prefix X# Let make expand exec_prefix. Xtest "x$exec_prefix" = xNONE && exec_prefix='${prefix}' X X# Any assignment to VPATH causes Sun make to only execute X# the first set of double-colon rules, so remove it if not needed. X# If there is a colon in the path, we need to keep it. Xif test "x$srcdir" = x.; then X ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' Xfi X Xtrap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 X XDEFS=-DHAVE_CONFIG_H X X# Without the "./", some shells look in PATH for config.status. X: ${CONFIG_STATUS=./config.status} X Xecho creating $CONFIG_STATUS Xrm -f $CONFIG_STATUS Xcat > $CONFIG_STATUS </dev/null | sed 1q`: X# X# $0 $ac_configure_args X# X# Compiler output produced by configure, useful for debugging X# configure, is in ./config.log if it exists. X Xac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" Xfor ac_option Xdo X case "\$ac_option" in X -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) X echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" X exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; X -version | --version | --versio | --versi | --vers | --ver | --ve | --v) X echo "$CONFIG_STATUS generated by autoconf version 2.12" X exit 0 ;; X -help | --help | --hel | --he | --h) X echo "\$ac_cs_usage"; exit 0 ;; X *) echo "\$ac_cs_usage"; exit 1 ;; X esac Xdone X Xac_given_srcdir=$srcdir Xac_given_INSTALL="$INSTALL" X Xtrap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 XEOF Xcat >> $CONFIG_STATUS < conftest.subs <<\\CEOF X$ac_vpsub X$extrasub Xs%@CFLAGS@%$CFLAGS%g Xs%@CPPFLAGS@%$CPPFLAGS%g Xs%@CXXFLAGS@%$CXXFLAGS%g Xs%@DEFS@%$DEFS%g Xs%@LDFLAGS@%$LDFLAGS%g Xs%@LIBS@%$LIBS%g Xs%@exec_prefix@%$exec_prefix%g Xs%@prefix@%$prefix%g Xs%@program_transform_name@%$program_transform_name%g Xs%@bindir@%$bindir%g Xs%@sbindir@%$sbindir%g Xs%@libexecdir@%$libexecdir%g Xs%@datadir@%$datadir%g Xs%@sysconfdir@%$sysconfdir%g Xs%@sharedstatedir@%$sharedstatedir%g Xs%@localstatedir@%$localstatedir%g Xs%@libdir@%$libdir%g Xs%@includedir@%$includedir%g Xs%@oldincludedir@%$oldincludedir%g Xs%@infodir@%$infodir%g Xs%@mandir@%$mandir%g Xs%@CC@%$CC%g Xs%@YACC@%$YACC%g Xs%@LEX@%$LEX%g Xs%@LEXLIB@%$LEXLIB%g Xs%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g Xs%@INSTALL_DATA@%$INSTALL_DATA%g Xs%@ESQL@%$ESQL%g Xs%@ecobjs@%$ecobjs%g Xs%@target@%$target%g Xs%@YFLAGS@%$YFLAGS%g Xs%@LFLAGS@%$LFLAGS%g Xs%@ESQLFLAGS@%$ESQLFLAGS%g X XCEOF XEOF X Xcat >> $CONFIG_STATUS <<\EOF X X# Split the substitutions into bite-sized pieces for seds with X# small command number limits, like on Digital OSF/1 and HP-UX. Xac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. Xac_file=1 # Number of current file. Xac_beg=1 # First line for current file. Xac_end=$ac_max_sed_cmds # Line after last line for current file. Xac_more_lines=: Xac_sed_cmds="" Xwhile $ac_more_lines; do X if test $ac_beg -gt 1; then X sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file X else X sed "${ac_end}q" conftest.subs > conftest.s$ac_file X fi X if test ! -s conftest.s$ac_file; then X ac_more_lines=false X rm -f conftest.s$ac_file X else X if test -z "$ac_sed_cmds"; then X ac_sed_cmds="sed -f conftest.s$ac_file" X else X ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" X fi X ac_file=`expr $ac_file + 1` X ac_beg=$ac_end X ac_end=`expr $ac_end + $ac_max_sed_cmds` X fi Xdone Xif test -z "$ac_sed_cmds"; then X ac_sed_cmds=cat Xfi XEOF X Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xfor ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then X # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". X case "$ac_file" in X *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` X ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; X *) ac_file_in="${ac_file}.in" ;; X esac X X # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. X X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` X if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then X # The file is in a subdirectory. X test ! -d "$ac_dir" && mkdir "$ac_dir" X ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" X # A "../" for each directory in $ac_dir_suffix. X ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` X else X ac_dir_suffix= ac_dots= X fi X X case "$ac_given_srcdir" in X .) srcdir=. X if test -z "$ac_dots"; then top_srcdir=. X else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; X /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; X *) # Relative path. X srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" X top_srcdir="$ac_dots$ac_given_srcdir" ;; X esac X X case "$ac_given_INSTALL" in X [/$]*) INSTALL="$ac_given_INSTALL" ;; X *) INSTALL="$ac_dots$ac_given_INSTALL" ;; X esac X X echo creating "$ac_file" X rm -f "$ac_file" X configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." X case "$ac_file" in X *Makefile*) ac_comsub="1i\\ X# $configure_input" ;; X *) ac_comsub= ;; X esac X X ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` X sed -e "$ac_comsub Xs%@configure_input@%$configure_input%g Xs%@srcdir@%$srcdir%g Xs%@top_srcdir@%$top_srcdir%g Xs%@INSTALL@%$INSTALL%g X" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file Xfi; done Xrm -f conftest.s* X X# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where X# NAME is the cpp macro being defined and VALUE is the value it is being given. X# X# ac_d sets the value in "#define NAME VALUE" lines. Xac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' Xac_dB='\([ ][ ]*\)[^ ]*%\1#\2' Xac_dC='\3' Xac_dD='%g' X# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". Xac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' Xac_uB='\([ ]\)%\1#\2define\3' Xac_uC=' ' Xac_uD='\4%g' X# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". Xac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' Xac_eB='$%\1#\2define\3' Xac_eC=' ' Xac_eD='%g' X Xif test "${CONFIG_HEADERS+set}" != set; then XEOF Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xfi Xfor ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then X # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". X case "$ac_file" in X *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` X ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; X *) ac_file_in="${ac_file}.in" ;; X esac X X echo creating $ac_file X X rm -f conftest.frag conftest.in conftest.out X ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` X cat $ac_file_inputs > conftest.in X XEOF X X# Transform confdefs.h into a sed script conftest.vals that substitutes X# the proper values into config.h.in to produce config.h. And first: X# Protect against being on the right side of a sed subst in config.status. X# Protect against being in an unquoted here document in config.status. Xrm -f conftest.vals Xcat > conftest.hdr <<\EOF Xs/[\\&%]/\\&/g Xs%[\\$`]%\\&%g Xs%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp Xs%ac_d%ac_u%gp Xs%ac_u%ac_e%gp XEOF Xsed -n -f conftest.hdr confdefs.h > conftest.vals Xrm -f conftest.hdr X X# This sed command replaces #undef with comments. This is necessary, for X# example, in the case of _POSIX_SOURCE, which is predefined and required X# on some systems where configure will not decide to define it. Xcat >> conftest.vals <<\EOF Xs%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% XEOF X X# Break up conftest.vals because some shells have a limit on X# the size of here documents, and old seds have small limits too. X Xrm -f conftest.tail Xwhile : Xdo X ac_lines=`grep -c . conftest.vals` X # grep -c gives empty output for an empty file on some AIX systems. X if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi X # Write a limited-size here document to conftest.frag. X echo ' cat > conftest.frag <> $CONFIG_STATUS X sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS X echo 'CEOF X sed -f conftest.frag conftest.in > conftest.out X rm -f conftest.in X mv conftest.out conftest.in X' >> $CONFIG_STATUS X sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail X rm -f conftest.vals X mv conftest.tail conftest.vals Xdone Xrm -f conftest.vals X Xcat >> $CONFIG_STATUS <<\EOF X rm -f conftest.frag conftest.h X echo "/* $ac_file. Generated automatically by configure. */" > conftest.h X cat conftest.in >> conftest.h X rm -f conftest.in X if cmp -s $ac_file conftest.h 2>/dev/null; then X echo "$ac_file is unchanged" X rm -f conftest.h X else X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` X if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then X # The file is in a subdirectory. X test ! -d "$ac_dir" && mkdir "$ac_dir" X fi X rm -f $ac_file X mv conftest.h $ac_file X fi Xfi; done X XEOF Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF X Xexit 0 XEOF Xchmod +x $CONFIG_STATUS Xrm -fr confdefs* $ac_clean_files Xtest "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 X SHAR_EOF chmod 0755 'configure' || $echo 'restore of' 'configure' 'failed' # ============= configure.in ============== $echo 'x -' extracting 'configure.in' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'configure.in' && Xdnl Process this file with autoconf to produce a configure script. XAC_INIT(FGLDOC-2.00) XAC_CONFIG_HEADER(config.h) X Xdnl Check for standard programs. XAC_PROG_CC XAC_PROG_YACC XAC_PROG_LEX XAC_PROG_INSTALL X Xdnl Check for working const. XAC_C_CONST X Xdnl Check whether to use ESQL/C. XAC_ARG_WITH(esqlc, X [ --without-esqlc do not use ESQL/C], X [ if test "$withval" = no; then X use_esqlc=no X else X use_esqlc="$withval" X fi ]) X Xdnl Check the Informix environment and ESQL/C setup. Xif test "$use_esqlc" != no; then X AC_INFORMIX_ENV X AC_PROG_ESQL X AC_FUNC_RGETLMSG X AC_DEFINE(HAVE_ESQLC) X ecobjs=read_pdbs.o X target=fgldoc-ec Xelse X ecobjs="" X target=fgldoc Xfi XAC_SUBST(ecobjs) XAC_SUBST(target) X Xdnl Default values for YFLAGS and LFLAGS, if not set. Xif test "x$YFLAGS" = x; then X YFLAGS=-d Xfi Xif test "x$LFLAGS" = x; then X LFLAGS="" Xfi XAC_SUBST(YFLAGS) XAC_SUBST(LFLAGS) X Xdnl Add LEXLIB to LIBS. XLIBS="$LIBS $LEXLIB" X Xdnl Do other substitutions. XAC_SUBST(ESQLFLAGS) X XAC_OUTPUT(Makefile) SHAR_EOF chmod 0644 'configure.in' || $echo 'restore of' 'configure.in' 'failed' # ============= fgldoc.1 ============== $echo 'x -' extracting 'fgldoc.1' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'fgldoc.1' && X.\" fgldoc, an Informix-4GL program documenter X.\" Copyright (c) 1995-1999 Ivan Nejgebauer X.\" X.\" This program is free software; you can redistribute it and/or modify X.\" it under the terms of the GNU General Public License as published by X.\" the Free Software Foundation; either version 2 of the License, or X.\" (at your option) any later version. X.\" X.\" This program is distributed in the hope that it will be useful, X.\" but WITHOUT ANY WARRANTY; without even the implied warranty of X.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X.\" GNU General Public License for more details. X.\" X.\" You should have received a copy of the GNU General Public License X.\" along with this program; if not, write to the Free Software X.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X.de SX X.ie t .sp .5v X.el .sp X.. X.TH FGLDOC 1 "" "" "" X.SH NAME Xfgldoc \- A documenter for Informix-4GL programs X.SH SYNOPSIS X.B fgldoc X.RB [ \-v ] X.RB [ \-s ] X.RB [ \-x X.IR modname [, modname ...]] X.if n .ti +7n X.RB [ \-apfro ] X.I progname X.SH DESCRIPTION X.B fgldoc Xreads a list of 4GL module names comprising the program X.I progname Xfrom the program design database or standard input (one name per line, Xwithout the X.I .4gl Xextension), parses the modules, and generates one or more summary listings Xon standard output. Verbosity of X.BR fgldoc 's Xoperation and the amount of summary information generated on output are Xcontrolled by command-line options. X.PP X.SH OPTIONS X.TP 4 X.B \-v XVerbose mode. The program's progress is reported to standard error output. X.TP 4 X.B \-s XUse standard input to read module names. This option is permanently set if Xthe program has been compiled without database support routines. X.TP 4 X.B \-x XThis option should be followed by a comma-separated list of additional Xmodules to be parsed. The modules are assumed to be in the current Xdirectory. There shouldn't be any whitespace in the list. The intended use Xof X.B \-x Xis to specify modules containing external function templates; see the X.B NOTES Xsection for discussion. X.TP 4 X.B \-a XPrint all summaries (program, function, report, form). This is the Xdefault. X.TP 4 X.B \-p XPrint the program summary, which reports the following: X.RS X.IP \- 3 XThe number of modules, name and line count for each module, and total LOC Xfor all modules. X.IP \- 3 XThe number of functions in the program. X.IP \- 3 XThe number of reports in the program. X.IP \- 3 XThe number of forms that the program activates, along with their names. X.RE X.TP 4 X.B \-f XPrint the function summary, which consists of two listings: X.SX X.IR "Function hierarchy" . XHierarchical list of functions, starting from X.BR main . XFor each function, the list of functions (reports, forms) which the function Xcalls is printed. If a called function is X.I non-terminal X(i.e., it makes one or more calls itself), the process is recursively Xapplied to that function. X.SX X.IR "Functions by name" . XAlphabetical list of functions (exception: X.B main Xis always displayed first, regardless of its actual lexicographic Xposition). For each function, the following information is provided: X.RS X.IP \- 3 XThe name of the module where it is defined. X.IP \- 3 XThe list of functions (reports, forms) which it calls. X.IP \- 3 XThe list of functions/reports which call the function. X.LP XIf a function is X.I orphaned X(i.e., defined but not called from anywhere in the progam), a hash sign ('#') Xwill be displayed before its name, in the first column of the line, making Xit easy to find all orphaned functions with something like X.nf X.SX X.ti +4n Xfgldoc \-f progname | grep '^#' X.fi X.RE X.TP 4 X.B \-r XPrint the report summary, which is similar in form to the second part of Xthe function summary. X.TP 4 X.B \-o XPrint the form summary. For each form, print its name and the list of Xfunctions which activate it. X.PP XOptions X.BR \-p , X.BR \-f , X.B \-r Xand X.B \-o Xcan be specified in any combination to produce just the desired summaries. XThe X.B \-a Xoption (which is, strictly speaking, redundant) is equivalent to X.BR \-pfro . XThe order of options does not affect the order in which the summaries are Xoutput. X.SH NOTES XWhen opening the program design database, X.B fgldoc Xwill first try to use the value of the environment variable XPROGRAM_DESIGN_DBS as the database name. If that variable is unset, the Xstandard name X.I syspgm4gl Xwill be used. X.PP XConnection to the program design database is made implicitly, for Xcompatibility with the older versions of ESQL/C libraries. There is no way Xto connect using a different username and password. X.PP XIf a character variable is used to specify the form file in OPEN FORM and XOPEN WINDOW... WITH FORM statements, X.B fgldoc Xwill print the variable identifier in all uppercase to distinguish it Xfrom file names given as literals. X.PP XBy design, functions for which the corresponding definition is not found in Xthe source are not reported anywhere (otherwise the parser could not have Xbeen as simple as it is). If you want to track foreign functions (e.g., Xin external libraries for compiled 4GL, or those in a custom p-code Xrunner), create one or more modules with dummy definitions and list their Xnames as an argument to the X.B \-x Xoption. For example, if an external function X.I foo() Xis used in the program X.IR bar , Xyou could create the file X.I .extern.4gl Xcontaining the lines X.SX X.nf X.in +4n XFUNCTION foo() XEND FUNCTION X.in -4n X.fi X.SX Xand invoke X.B fgldoc Xas follows: X.SX X.nf X.ti +4n Xfgldoc \-x .extern bar X.fi X.SH AUTHOR XIvan Nejgebauer SHAR_EOF chmod 0644 'fgldoc.1' || $echo 'restore of' 'fgldoc.1' 'failed' # ============= fgldoc.c ============== $echo 'x -' extracting 'fgldoc.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'fgldoc.c' && X/* X * fgldoc, an Informix-4GL program documenter X * Copyright (c) 1995-1998 Ivan Nejgebauer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X */ X X/* X * REVISION HISTORY: X * X * 2.00 Jun 1999 ian X * X * Major revamp (but without disturbing the internals too much). New X * and improved: X * X * o Source configuration with Autoconf; X * X * o Reading of the program database is back, using ESQL/C instead of X * raw C/ISAM (punted in 1.15). The PROGRAM_DESIGN_DBS environment X * variable is honored. Programmer's environments from 4.x to 7.20 X * are supported; X * X * o 4GL modules outside the current directory are supported; X * X * o The parser has been updated to recognize the use of character X * variables in OPEN FORM and OPEN WINDOW. Internal functions added X * since 4.00 are also there; X * X * o The program is now named "fgldoc". X * X * 1.16 Nov 1998 ian X * X * More portability tweaks in parser.y and lexer.l. X * X * 1.15 Apr 1998 ian X * X * Threw out C-ISAM calls and got rid of ugly #defines. X * X * 1.13 Mar 1995 ian X * X * Now using bison instead of yacc. X * X * 1.12 Jan 1995 ian X * X * Integrated database search, recompiled for Xenix 386. Hopefully, X * improved portability. X * X * Eliminated the '!' printing glitch from the form summary. X * X * 1.10 Jan 1995 ian X * X * If no modulelist is given on stdin, forks a process which attempts to X * access the program database and read module names from it. X * X * Recursive functions are properly handled in the hierarchy report. X * X * 1.00 Jan 1995 ian X */ X X#include "config.h" X#include X#include X#include X#include X#include "fgldoc.h" X X#define MODNAME_LEN_MAX 10 X#define IDENT_LEN_MAX 18 X X/* externs */ Xextern FILE *yyin; Xint yyparse(); X Xenum { MOD, FUN, RPT, FRM }; /* node types */ Xenum { TADD, TSCAN }; /* tree scan modes */ Xenum { CALLS, CALLEDBY }; /* call list identifiers */ X X/* list and tree node structs */ Xstruct TAG_flist; X Xtypedef struct TAG_fnode { X char name[20]; X char *path; X int type; X struct TAG_fnode *module; X struct TAG_flist *cllist; X struct TAG_flist *cblist; X int passed; X struct TAG_fnode *left; X struct TAG_fnode *right; X} Fnode; X Xtypedef struct TAG_flist { X Fnode *nptr; X struct TAG_flist *next; X} Flist; X X/* globals */ Xint verbose; /* verbose mode */ X X/* global functions */ Xvoid yyerror(char *s); Xint regmod(char *name, char *path); X X/* local functions */ Xstatic Fnode *treescan(Fnode *root, char *name, int scanonly); Xstatic void upd_flist(Fnode *of, Fnode *by, int which); Xstatic int get_modules(char *progarg, char *extmod); Xstatic void read_stdin(void); Xstatic void modwalk(Fnode *mp); Xstatic void mods_process(void); Xstatic void heading(char *title); Xstatic int ps_mwalk(Fnode *mp); Xstatic void ps_owalk(Fnode *op); Xstatic void prog_summ(void); Xstatic void func_summ(void); Xstatic void rept_summ(void); Xstatic void os_owalk(Fnode *op); Xstatic void fs_fwalk(Fnode *fp); Xstatic void fs_hier(Fnode *fp, int lev); Xstatic void eprint(char *out, Flist *le); Xstatic char *rtrim(char *s); Xstatic void form_summ(void); Xstatic void usage(void); X X/* local data */ Xstatic Fnode *cmod, *cfun; /* current module, func */ Xstatic Fnode *modr, *funr, *rptr, *frmr; /* root nodes */ Xstatic char prog[11]; /* program name */ Xstatic int nmods, nfuns, nreps, nfrms; /* counts */ X X#ifdef HAVE_ESQLC Xstatic int readstdin = 0; /* module list from standard */ X#else /* input: force if we don't */ Xstatic int readstdin = 1; /* have ESQL/C */ X#endif X X/* scan symbol tree, add node if requested */ Xstatic Fnode * Xtreescan(Fnode *root, char *name, int scanonly) X{ X Fnode *p = root, *q = NULL; X int cond = 0; X X while (p) { X q = p; X if ((cond = strcmp(name, p->name)) == 0) X break; X else if (cond < 0) X p = p->left; X else X p = p->right; X } X if (scanonly) X return p; X if (!p) X if ((p = (Fnode *) calloc(1, sizeof(Fnode))) == NULL) { X fprintf(stderr, "fgldoc: FATAL: malloc failed\n"); X exit(1); X } else { X p->module = p->left = p->right = NULL; X p->cllist = p->cblist = NULL; X } X if (cond < 0) X q->left = p; X else if (cond > 0) X q->right = p; X return p; X} X X/* update calling and called-by lists of a node */ Xstatic void Xupd_flist(Fnode *of, Fnode *by, int which) X{ X Flist *head, *curr, *prev; X X head = (which == CALLS) ? of->cllist : of->cblist; X for (prev = curr = head; curr; prev = curr, curr = curr->next) X if (by == curr->nptr) X break; X if (curr) X return; X if ((curr = (Flist *) malloc(sizeof(Flist))) == NULL) { X fprintf(stderr, "fgldoc: FATAL: malloc failed\n"); X exit(1); X } X curr->nptr = by; X curr->next = NULL; X if (head) X prev->next = curr; X else if (which == CALLS) X of->cllist = curr; X else X of->cblist = curr; X} X X/* register a function, called from the parser */ Xvoid Xregfun(char *name) X{ X Fnode *temp = treescan(funr, name, TADD); X X if (!funr) X funr = temp; X if (!(temp->name)[0]) X strncpy(temp->name, name, IDENT_LEN_MAX); X nfuns++; X temp->type = FUN; X temp->module = cmod; X cfun = temp; X} X X/* register a function call, called from the parser */ Xvoid Xregfcall(char *name) X{ X Fnode *temp = treescan(funr, name, TADD); X X if (!(temp->name)[0]) X strncpy(temp->name, name, IDENT_LEN_MAX); X temp->type = FUN; X upd_flist(temp, cfun, CALLEDBY); X upd_flist(cfun, temp, CALLS); X} X X/* register a report, called from the parser */ Xvoid Xregrep(char *name) X{ X Fnode *temp = treescan(rptr, name, TADD); X X if (!rptr) X rptr = temp; X if (!(temp->name)[0]) X strncpy(temp->name, name, IDENT_LEN_MAX); X nreps++; X temp->type = RPT; X temp->module = cmod; X cfun = temp; X} X X/* register a report call, called from the parser */ Xvoid Xregrcall(char *name) X{ X Fnode *temp = treescan(rptr, name, TADD); X X if (!rptr) X rptr = temp; X if (!(temp->name)[0]) X strncpy(temp->name, name, IDENT_LEN_MAX); X temp->type = RPT; X upd_flist(temp, cfun, CALLEDBY); X upd_flist(cfun, temp, CALLS); X} X X/* register a form opening, called from the parser */ Xvoid Xregfrm(char *name) X{ X Fnode *temp = treescan(frmr, name, TADD); X X if (!frmr) X frmr = temp; X if (!(temp->name)[0]) { X strncpy(temp->name, name, IDENT_LEN_MAX); X nfrms++; X } X temp->module = (Fnode *) 1; /* fake module */ X temp->type = FRM; X upd_flist(temp, cfun, CALLEDBY); X upd_flist(cfun, temp, CALLS); X} X X/* X * get the module list: from stdin if -s was specified or the program X * lacks ESQL/C support, otherwise try to read the program database. X * Process the modules named in extmod first. X */ Xstatic int Xget_modules(char *progarg, char *extmod) X{ X prog[sizeof prog - 1] = '\0'; X strncpy(prog, progarg, sizeof prog - 1); X X if (extmod) { X char *s = extmod; X char *t; X X do { X t = strchr(s, ','); X if (t) X *t++ = '\0'; X if (*s) X regmod(s, "."); X if (t) X s = t; X } while (t); X } X X if (readstdin) X read_stdin(); X#ifdef HAVE_ESQLC X else X read_progdbs(prog, regmod); X#endif X X return (modr != NULL); X} X X/* read stdin, separate name and path elements and register them */ Xstatic void Xread_stdin(void) X{ X char modline[256]; X char *mpath, *mname; X char *t; X X while (fgets(modline, sizeof modline, stdin) == modline) { X t = rtrim(modline); X *t = '\0'; X t = strrchr(modline, '/'); X if (t) { X *t++ = '\0'; X if (!*t || !modline[0]) /* junks modules in / -- BFD */ X continue; X regmod(t, modline); X } else if (modline[0]) X regmod(modline, "."); X } X} X X/* register modules as they are read */ Xint Xregmod(char *name, char *path) X{ X Fnode *temp; X X nmods++; X temp = treescan(modr, name, TADD); X if (!modr) X modr = temp; X strncpy(temp->name, name, MODNAME_LEN_MAX); X temp->path = (char *) malloc(strlen(path) + MODNAME_LEN_MAX + 6); X if (temp->path == NULL) { X fprintf(stderr, "fgldoc: FATAL: malloc failed\n"); X exit(1); X } X strcpy(temp->path, path); X X return 0; /* bogus */ X} X X/* process all modules recursively */ Xstatic void Xmodwalk(Fnode *mp) X{ X static FILE *modfp; X X if (mp) { X modwalk(mp->left); X strcat(mp->path, "/"); X strcat(mp->path, mp->name); X strcat(mp->path, ".4gl"); X if ((modfp = fopen(mp->path, "r")) == NULL) { X fprintf(stderr, "fgldoc: cannot open '%s'\n", mp->path); X exit(1); X } X if (verbose) { X fprintf(stderr, " %-10s %6d", mp->name, 0); X fflush(stderr); X } X cmod = mp; X yyin = modfp; X lineno = 1; X if (yyparse()) X exit(1); X mp->passed = --lineno; X if (verbose) X fprintf(stderr, "\b\b\b\b\b\b%6d\n", mp->passed); X fclose(modfp); X modwalk(mp->right); X } X} X X/* parser error printing routine */ Xvoid Xyyerror(char *s) X{ X if (verbose) X fprintf(stderr, "\n"); X fprintf(stderr, "fgldoc: %s, module '%s', line %d\n", X s, cmod->name, lineno); X} X X/* start module processing */ Xstatic void Xmods_process(void) X{ X Fnode *temp; X X modwalk(modr); X temp = treescan(funr, "!main", TSCAN); X if (!temp) { X fprintf(stderr, "fgldoc: no main symbol\n"); X exit(1); X } X printf("\ XFGLDOC: Informix-4GL Program Documenter v2.00\n\ XCopyright (c) 1995-1999 Ivan Nejgebauer\n\n"); X printf("PROGRAM: %s\n", prog); X} X X/* print summary heading */ Xstatic void Xheading(char *title) X{ X int i, len = strlen(title) + 12; X char sep[30]; X X for (i = 0; i < len; i++) X sep[i] = '*'; X sep[i] = '\0'; X printf("\n%s\n* %s SUMMARY *\n%s\n\n", sep, title, sep); X} X X/* print all module names */ Xstatic int Xps_mwalk(Fnode *mp) X{ X static int lsum = 0; X X if (mp) { X lsum += mp->passed; X ps_mwalk(mp->left); X printf(" %-10s %6d\n", mp->name, mp->passed); X ps_mwalk(mp->right); X } X return lsum; X} X X/* print all form names */ Xstatic void Xps_owalk(Fnode *op) X{ X if (op) { X ps_owalk(op->left); X printf(" %s\n", op->name); X ps_owalk(op->right); X } X} X X/* print program summary */ Xstatic void Xprog_summ(void) X{ X if (verbose) X fprintf(stderr, "Writing program summary...\n"); X heading("PROGRAM"); X printf("Modules: %d\n", nmods); X printf(" -------\n Lines: %7d\n", ps_mwalk(modr)); X printf("\nFunctions: %d\n", nfuns - 1); X printf("\nReports: %d\n", nreps); X printf("\nForms: %d\n", nfrms); X ps_owalk(frmr); X} X X/* print an entry from the cl or cb list */ Xstatic void Xeprint(char *out, Flist *le) X{ X int type = le->nptr->type; X int ismain = *le->nptr->name == '!'; X char t[30]; X X if (type == RPT || type == FRM) X sprintf(t, "%s %-18s ", (type == RPT) ? "(r)" : "(f)", le->nptr->name); X else X sprintf(t, "%-22s ", le->nptr->name + ismain); X strcat(out, t); X} X X/* clip a string */ Xstatic char X*rtrim(char *s) X{ X int c; X char *t = s + strlen(s); X X while (t > s && ((c = *--t) == ' ' || c == '\n')) X ; X return t + (*t && !isspace(*t)); X} X X/* function hierarchy */ Xstatic void Xfs_hier(Fnode *fp, int lev) X{ X Flist *cl; X static int ismain, fline, c; X static char out[80]; X static char *outtr; X X ismain = *fp->name == '!'; X fline = 1; X sprintf(out, "%3d %-18s %-10s ", lev, fp->name + ismain, fp->module->name); X for (cl = fp->cllist; cl; cl = cl->next) { X if (!fline) X strcpy(out, " "); X if (cl->nptr->module) { X eprint(out, cl); X if (cl->nptr->module != (Fnode *) 1) X strcat(out, cl->nptr->module->name); X } else X continue; X if ((outtr = rtrim(out)) != out) { X *outtr = '\0'; X printf("%s\n", out); X } X fline = 0; X } X for (cl = fp->cllist; cl; cl = cl->next) X if (cl->nptr->module && !cl->nptr->passed && fp != cl->nptr X && (c = cl->nptr->type) != RPT && c != FRM) { X fs_hier(cl->nptr, lev + 1); X cl->nptr->passed = 1; X } X} X X/* functions by name */ Xstatic void Xfs_fwalk(Fnode *fp) X{ X static int fline; X static Flist *cl, *cb; X static char out[80]; X static char *outtr; X X if (fp) { X fs_fwalk(fp->left); X fline = 1; X cl = fp->cllist; X cb = fp->cblist; X do { X if (!fp->module) X break; X if (fline) { X int ismain = *fp->name == '!'; X X sprintf(out, "%c%-18s %-10s ", (cb || ismain) ? ' ' : '#', X fp->name + ismain, fp->module->name); X fline = 0; X } else X strcpy(out, " "); X while (cl && !cl->nptr->module) X cl = cl->next; X if (cl) X eprint(out, cl); X else X strcat(out, " "); X if (cb) { X eprint(out, cb); X cb = cb->next; X } X if (cl) X cl = cl->next; X if ((outtr = rtrim(out)) != out) { X *outtr = '\0'; X printf("%s\n", out); X } X } while (cb || cl); X fs_fwalk(fp->right); X } X} X X/* print function summary */ Xstatic void Xfunc_summ(void) X{ X if (!funr) X return; X if (verbose) X fprintf(stderr, "Writing function summary...\n"); X heading("FUNCTION"); X printf("\ Xa) Function Hierarchy\n\ X-------------------------------------------------------------------\n\ XLev Name Module Calls In-Module\n\ X-------------------------------------------------------------------\n"); X fs_hier(treescan(funr, "!main", TSCAN), 0); X printf("\n\ Xb) Functions by Name\n\ X------------------------------------------------------------------------\n\ X Name Module Calls Called-by\n\ X------------------------------------------------------------------------\n"); X fs_fwalk(funr); X} X X/* print report summary */ Xstatic void Xrept_summ(void) X{ X if (!rptr) X return; X if (verbose) X fprintf(stderr, "Writing report summary...\n"); X heading("REPORT"); X printf("\ X------------------------------------------------------------------------\n\ X Name Module Calls Called-by\n\ X------------------------------------------------------------------------\n"); X fs_fwalk(rptr); X} X X/* forms by name */ Xstatic void Xos_owalk(Fnode *op) X{ X static int fline, ismain; X static Flist *temp; X X if (op) { X os_owalk(op->left); X printf(" %-18s ", op->name); X fline = 1; X for (temp = op->cblist; temp; temp = temp->next) { X ismain = *temp->nptr->name == '!'; X if (!fline) X printf(" "); X printf("%-18s %-10s\n", temp->nptr->name + ismain, X temp->nptr->module->name); X fline = 0; X } X os_owalk(op->right); X } X} X X/* print form summary */ Xstatic void Xform_summ(void) X{ X if (!frmr) X return; X if (verbose) X fprintf(stderr, "Writing form summary...\n"); X heading("FORM"); X printf("\ X-------------------------------------------------\n\ X Name Called-by In-Module\n\ X-------------------------------------------------\n"); X os_owalk(frmr); X} X X/* usage */ Xstatic void Xusage(void) X{ X fprintf(stderr, "\ XFGLDOC: Informix-4GL Program Documenter v2.00\n\ XCopyright (c) 1995-1999 Ivan Nejgebauer\n\n"); X fprintf(stderr, "\ XUSAGE:\n\n\ Xfgldoc [-v] [-s] [-x modname[,modname...]] [-apfro] progname\n\n\ X -v verbose option, diagnostics to stderr\n\ X -s read module list from standard input\n\n\ X -x add named modules to module list\n\n\ X -a output all summaries (default)\n\ X -p output program summary\n\ X -f output function summary\n\ X -r output report summary\n\ X -o output form summary\n\n\ X Options p, f, r and o may be combined as needed.\n"); X exit(1); X} X Xint Xmain(int argc, char *argv[]) X{ X char *extmod = NULL; X int c; X extern int optind, opterr; X extern char *optarg; X int dopsum, dofsum, dorsum, doosum; X X dopsum = dofsum = dorsum = doosum = 0; X opterr = 0; X while ((c = getopt(argc, argv, "vsx:apfro")) != -1) X switch (c) { X case 'a': X dopsum = dofsum = dorsum = doosum = 1; X break; X case 'p': X dopsum = 1; X break; X case 'f': X dofsum = 1; X break; X case 'r': X dorsum = 1; X break; X case 'o': X doosum = 1; X break; X case 'v': X verbose = 1; X break; X case 's': X readstdin = 1; X break; X case 'x': X extmod = optarg; X break; X default: X usage(); X } X if (optind >= argc) X usage(); X if (!get_modules(argv[optind], extmod)) X return 1; X if (verbose) X fprintf(stderr, "Program: %s\n", prog); X if (!(dopsum || dofsum || dorsum || doosum)) X dopsum = dofsum = dorsum = doosum = 1; X mods_process(); X if (dopsum) X prog_summ(); X if (dofsum) X func_summ(); X if (dorsum) X rept_summ(); X if (doosum) X form_summ(); X if (verbose) X fprintf(stderr, "Done.\n"); X return 0; X} SHAR_EOF chmod 0644 'fgldoc.c' || $echo 'restore of' 'fgldoc.c' 'failed' # ============= fgldoc.h ============== $echo 'x -' extracting 'fgldoc.h' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'fgldoc.h' && X/* X * fgldoc, an Informix-4GL program documenter X * Copyright (c) 1995-1998 Ivan Nejgebauer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X */ X X/* X * 2.00 Jun 1999 ian X * X * 1.16 Nov 1998 ian X * X * 1.00 Jan 1995 ian X */ X X/* from fgldoc.c */ Xvoid regfun(char *name); Xvoid regfcall(char *name); Xvoid regrep(char *name); Xvoid regrcall(char *name); Xvoid regfrm(char *name); X X/* from read_pdbs.ec (if applicable) */ X#ifdef HAVE_ESQLC Xint read_progdbs(char *pname, int (*mod_reg_func)()); X#endif X X/* from lexer.l */ Xextern int lineno; Xextern char matched[]; SHAR_EOF chmod 0644 'fgldoc.h' || $echo 'restore of' 'fgldoc.h' 'failed' # ============= fgldoc.txt ============== $echo 'x -' extracting 'fgldoc.txt' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'fgldoc.txt' && X XFGLDOC(1) FGLDOC(1) X XNAME X fgldoc - A documenter for Informix-4GL programs X XSYNOPSIS X fgldoc [-v] [-s] [-x modname[,modname...]] X [-apfro] progname X XDESCRIPTION X fgldoc reads a list of 4GL module names comprising the program progname X from the program design database or standard input (one name per line, X without the .4gl extension), parses the modules, and generates one or X more summary listings on standard output. Verbosity of fgldoc's opera- X tion and the amount of summary information generated on output are con- X trolled by command-line options. X XOPTIONS X -v Verbose mode. The program's progress is reported to standard error X output. X X -s Use standard input to read module names. This option is perma- X nently set if the program has been compiled without database sup- X port routines. X X -x This option should be followed by a comma-separated list of addi- X tional modules to be parsed. The modules are assumed to be in the X current directory. There shouldn't be any whitespace in the list. X The intended use of -x is to specify modules containing external X function templates; see the NOTES section for discussion. X X -a Print all summaries (program, function, report, form). This is the X default. X X -p Print the program summary, which reports the following: X X - The number of modules, name and line count for each module, and X total LOC for all modules. X X - The number of functions in the program. X X - The number of reports in the program. X X - The number of forms that the program activates, along with their X names. X X -f Print the function summary, which consists of two listings: X X Function hierarchy. Hierarchical list of functions, starting from X main. For each function, the list of functions (reports, forms) X which the function calls is printed. If a called function is non- X terminal (i.e., it makes one or more calls itself), the process is X recursively applied to that function. X X Functions by name. Alphabetical list of functions (exception: main X is always displayed first, regardless of its actual lexicographic X position). For each function, the following information is pro- X vided: X X - The name of the module where it is defined. X X - The list of functions (reports, forms) which it calls. X X - The list of functions/reports which call the function. X X If a function is orphaned (i.e., defined but not called from any- X where in the progam), a hash sign ('#') will be displayed before X its name, in the first column of the line, making it easy to find X all orphaned functions with something like X X fgldoc -f progname | grep '^#' X X -r Print the report summary, which is similar in form to the second X part of the function summary. X X -o Print the form summary. For each form, print its name and the list X of functions which activate it. X X Options -p, -f, -r and -o can be specified in any combination to pro- X duce just the desired summaries. The -a option (which is, strictly X speaking, redundant) is equivalent to -pfro. The order of options does X not affect the order in which the summaries are output. X XNOTES X When opening the program design database, fgldoc will first try to use X the value of the environment variable PROGRAM_DESIGN_DBS as the X database name. If that variable is unset, the standard name syspgm4gl X will be used. X X Connection to the program design database is made implicitly, for com- X patibility with the older versions of ESQL/C libraries. There is no X way to connect using a different username and password. X X If a character variable is used to specify the form file in OPEN FORM X and OPEN WINDOW... WITH FORM statements, fgldoc will print the variable X identifier in all uppercase to distinguish it from file names given as X literals. X X By design, functions for which the corresponding definition is not X found in the source are not reported anywhere (otherwise the parser X could not have been as simple as it is). If you want to track foreign X functions (e.g., in external libraries for compiled 4GL, or those in a X custom p-code runner), create one or more modules with dummy defini- X tions and list their names as an argument to the -x option. For exam- X ple, if an external function foo() is used in the program bar, you X could create the file .extern.4gl containing the lines X X FUNCTION foo() X END FUNCTION X X and invoke fgldoc as follows: X X fgldoc -x .extern bar X XAUTHOR X Ivan Nejgebauer X SHAR_EOF chmod 0644 'fgldoc.txt' || $echo 'restore of' 'fgldoc.txt' 'failed' # ============= install-sh ============== $echo 'x -' extracting 'install-sh' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'install-sh' && X#! /bin/sh X# X# install - install a program, script, or datafile X# This comes from X11R5 (mit/util/scripts/install.sh). X# X# Copyright 1991 by the Massachusetts Institute of Technology X# X# Permission to use, copy, modify, distribute, and sell this software and its X# documentation for any purpose is hereby granted without fee, provided that X# the above copyright notice appear in all copies and that both that X# copyright notice and this permission notice appear in supporting X# documentation, and that the name of M.I.T. not be used in advertising or X# publicity pertaining to distribution of the software without specific, X# written prior permission. M.I.T. makes no representations about the X# suitability of this software for any purpose. It is provided "as is" X# without express or implied warranty. X# X# Calling this script install-sh is preferred over install.sh, to prevent X# `make' implicit rules from creating a file called install from it X# when there is no Makefile. X# X# This script is compatible with the BSD install script, but was written X# from scratch. It can only install one file at a time, a restriction X# shared with many OS's install programs. X X X# set DOITPROG to echo to test this script X X# Don't use :- since 4.3BSD and earlier shells don't like it. Xdoit="${DOITPROG-}" X X X# put in absolute paths if you don't have them in your path; or use env. vars. X Xmvprog="${MVPROG-mv}" Xcpprog="${CPPROG-cp}" Xchmodprog="${CHMODPROG-chmod}" Xchownprog="${CHOWNPROG-chown}" Xchgrpprog="${CHGRPPROG-chgrp}" Xstripprog="${STRIPPROG-strip}" Xrmprog="${RMPROG-rm}" Xmkdirprog="${MKDIRPROG-mkdir}" X Xtransformbasename="" Xtransform_arg="" Xinstcmd="$mvprog" Xchmodcmd="$chmodprog 0755" Xchowncmd="" Xchgrpcmd="" Xstripcmd="" Xrmcmd="$rmprog -f" Xmvcmd="$mvprog" Xsrc="" Xdst="" Xdir_arg="" X Xwhile [ x"$1" != x ]; do X case $1 in X -c) instcmd="$cpprog" X shift X continue;; X X -d) dir_arg=true X shift X continue;; X X -m) chmodcmd="$chmodprog $2" X shift X shift X continue;; X X -o) chowncmd="$chownprog $2" X shift X shift X continue;; X X -g) chgrpcmd="$chgrpprog $2" X shift X shift X continue;; X X -s) stripcmd="$stripprog" X shift X continue;; X X -t=*) transformarg=`echo $1 | sed 's/-t=//'` X shift X continue;; X X -b=*) transformbasename=`echo $1 | sed 's/-b=//'` X shift X continue;; X X *) if [ x"$src" = x ] X then X src=$1 X else X # this colon is to work around a 386BSD /bin/sh bug X : X dst=$1 X fi X shift X continue;; X esac Xdone X Xif [ x"$src" = x ] Xthen X echo "install: no input file specified" X exit 1 Xelse X true Xfi X Xif [ x"$dir_arg" != x ]; then X dst=$src X src="" X X if [ -d $dst ]; then X instcmd=: X else X instcmd=mkdir X fi Xelse X X# Waiting for this to be detected by the "$instcmd $src $dsttmp" command X# might cause directories to be created, which would be especially bad X# if $src (and thus $dsttmp) contains '*'. X X if [ -f $src -o -d $src ] X then X true X else X echo "install: $src does not exist" X exit 1 X fi X X if [ x"$dst" = x ] X then X echo "install: no destination specified" X exit 1 X else X true X fi X X# If destination is a directory, append the input filename; if your system X# does not like double slashes in filenames, you may need to add some logic X X if [ -d $dst ] X then X dst="$dst"/`basename $src` X else X true X fi Xfi X X## this sed command emulates the dirname command Xdstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` X X# Make sure that the destination directory exists. X# this part is taken from Noah Friedman's mkinstalldirs script X X# Skip lots of stat calls in the usual case. Xif [ ! -d "$dstdir" ]; then XdefaultIFS=' X' XIFS="${IFS-${defaultIFS}}" X XoIFS="${IFS}" X# Some sh's can't handle IFS=/ for some reason. XIFS='%' Xset - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` XIFS="${oIFS}" X Xpathcomp='' X Xwhile [ $# -ne 0 ] ; do X pathcomp="${pathcomp}${1}" X shift X X if [ ! -d "${pathcomp}" ] ; X then X $mkdirprog "${pathcomp}" X else X true X fi X X pathcomp="${pathcomp}/" Xdone Xfi X Xif [ x"$dir_arg" != x ] Xthen X $doit $instcmd $dst && X X if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && X if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && X if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && X if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi Xelse X X# If we're going to rename the final executable, determine the name now. X X if [ x"$transformarg" = x ] X then X dstfile=`basename $dst` X else X dstfile=`basename $dst $transformbasename | X sed $transformarg`$transformbasename X fi X X# don't allow the sed command to completely eliminate the filename X X if [ x"$dstfile" = x ] X then X dstfile=`basename $dst` X else X true X fi X X# Make a temp file name in the proper directory. X X dsttmp=$dstdir/#inst.$$# X X# Move or copy the file name to the temp name X X $doit $instcmd $src $dsttmp && X X trap "rm -f ${dsttmp}" 0 && X X# and set any options; do chmod last to preserve setuid bits X X# If any of these fail, we abort the whole thing. If we want to X# ignore errors from any of these, just make sure not to ignore X# errors from the above "$doit $instcmd $src $dsttmp" command. X X if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && X if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && X if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && X if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && X X# Now rename the file to the real destination. X X $doit $rmcmd -f $dstdir/$dstfile && X $doit $mvcmd $dsttmp $dstdir/$dstfile X Xfi && X X Xexit 0 SHAR_EOF chmod 0755 'install-sh' || $echo 'restore of' 'install-sh' 'failed' # ============= lexer.l ============== $echo 'x -' extracting 'lexer.l' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'lexer.l' && X%{ X/* X * fgldoc, an Informix-4GL program documenter X * Copyright (c) 1995-1999 Ivan Nejgebauer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X */ X X/* X * 2.00 Jun 1999 ian X * X * 1.16 Nov 1998 ian X * X * 1.00 Jan 1995 ian X */ X X#include "config.h" X#include X#include X#include X#include "y.tab.h" X X/* from fglref.c */ Xextern int verbose; X X/* globals */ Xint lineno; Xchar matched[256]; X X/* local functions */ Xstatic void ldisp(void); Xstatic void skipcmt(int cmtend); Xstatic void cpstring(int delimiter); Xstatic int chktok(char *yp); Xstatic int rwcmp(const void *cptr, const void *rptr); X X%} X XTOKEN [_a-zA-Z][_a-zA-Z0-9]* XINTNUM [0-9]+ X X%% X X\# { skipcmt('\n'); } X-- { skipcmt('\n'); } X\{ { skipcmt('}'); } X\" { cpstring('\"'); return STRING; } X' { cpstring('\''); return STRING; } X{TOKEN} { return chktok(yytext); } X{INTNUM} { return ANYTHING; } X[ \t]+ { /* eat up whitespace */ } X\n { lineno++; if (verbose && !(lineno % 100)) ldisp(); } X"," { return ','; } X"(" { return '('; } X. { return ANYTHING; } X X%% X Xtypedef struct { X char *toktext; X int tokval; X} Token; X X/* reserved words */ Xstatic Token reswords[] = { X "at", AT, X "end", END, X "finish", FINISH, X "form", FORM, X "from", FROM, X "function", FUNCTION, X "main", MAIN, X "open", OPEN, X "output", OUTPUT, X "report", REPORT, X "start", START, X "to", TO, X "window", WINDOW, X "with", WITH, X}; X X#define NRESWORDS (sizeof reswords / sizeof(Token)) X X/* display line numbers in increments by 100 if verbose mode set */ Xstatic void Xldisp(void) X{ X fprintf(stderr, "\b\b\b\b\b\b%6d", lineno); X fflush(stderr); X} X X/* skip a comment until the char sent */ Xstatic void Xskipcmt(int cmtend) X{ X int c; X X while ((c = input()) != EOF) { X if (c == '\n') X lineno++; X if (c == cmtend) X break; X } X} X X/* copy a string, paying attention to doubled delimiters and escaped chars */ Xstatic void Xcpstring(int delimiter) X{ X int c; X int last = 0; X int escape = 0; X int i = 0; X X while ((c = input()) != EOF) { X if (last == delimiter && c != delimiter) { X unput(c); X break; X } X if (c == '\n') X lineno++; X if (c == delimiter && last != delimiter && last != '\\') { X last = c; X continue; X } else if (last == delimiter || last == '\\') X last = 0; X else X last = c; X if (c == '\\' && !escape) { X escape = 1; X continue; X } X escape = 0; X if (i < sizeof matched - 1) X matched[i++] = c; X } X matched[i] = '\0'; X} X Xstatic int Xrwcmp(const void *cptr, const void *rptr) X{ X Token *c = (Token *) cptr; X Token *r = (Token *) rptr; X X c->tokval = r->tokval; X return strcmp(c->toktext, r->toktext); X} X X/* check a token */ Xstatic int Xchktok(char *yp) X{ X int i; X char tok[64]; X Token curr; X X for (i = 0; i < sizeof tok - 1 && (tok[i] = tolower(*yp++)); i++) X ; X tok[i] = '\0'; X curr.toktext = tok; X curr.tokval = 0; X strcpy(matched, tok); X if (bsearch(&curr, reswords, NRESWORDS, sizeof(Token), rwcmp)) X return curr.tokval; X else X return IDENT; X} SHAR_EOF chmod 0644 'lexer.l' || $echo 'restore of' 'lexer.l' 'failed' # ============= parser.y ============== $echo 'x -' extracting 'parser.y' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'parser.y' && X%{ X/* X * fgldoc, an Informix-4GL program documenter X * Copyright (c) 1995-1999 Ivan Nejgebauer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X */ X X/* X * 2.00 Jun 1999 ian X * X * 1.16 Nov 1998 ian X * X * 1.00 Jan 1995 ian X */ X X#include "config.h" X#include X#include X#include X#include "fgldoc.h" X X/* local functions */ Xstatic int bltincmp(const void *i1, const void *i2); Xstatic int bltin(char *ident); Xstatic char *uc_ident(char *ident); X X%} X X%token MAIN FUNCTION REPORT END X%token START OUTPUT TO FINISH X%token OPEN WINDOW AT WITH X%token FORM FROM X%token STRING IDENT ANYTHING X X%start fglfile X X%% X Xfglfile : /* empty */ X | clauses X ; X Xclauses : clause X | clauses clause X ; X Xclause : startblock X | endblock X | reportstmt X | fcall X | openstmt X | freetext X ; X Xstartblock: MAIN { regfun("!main"); } X | FUNCTION IDENT { regfun(matched); } X | REPORT IDENT { regrep(matched); } X ; X Xendblock: END MAIN X | END FUNCTION X | END REPORT X | END IDENT X ; X Xreportstmt: START REPORT IDENT { regrcall(matched); } X | OUTPUT TO REPORT IDENT X | OUTPUT REPORT X | OUTPUT IDENT X | FINISH REPORT X ; X Xfcall : IDENT '(' { X if (!bltin(matched)) X regfcall(matched); X } X ; X Xopenstmt: OPEN WINDOW IDENT AT iexpr ',' iexpr WITH wopts X | OPEN FORM IDENT FROM STRING { regfrm(matched); } X | OPEN FORM IDENT FROM IDENT { regfrm(uc_ident(matched)); } X | OPEN IDENT X ; X Xiexpr : IDENT X | ANYTHING X ; X Xwopts : FORM STRING { regfrm(matched); } X | FORM IDENT { regfrm(uc_ident(matched)); } X | IDENT X | ANYTHING X ; X Xfreetext: ANYTHING X | IDENT X | STRING X | WINDOW X | FORM X | FROM X | TO X | AT X | ',' X | '(' X ; X X%% X Xstatic char *builtin[] = { X "all", X "and", X "arg_count", X "arg_val", X "arr_count", X "arr_curr", X "attribute", X "average", X "avg", X "between", X "case", X "char", X "character", X "count", X "cursor_name", X "date", X "day", X "downshift", X "err_get", X "err_print", X "err_quit", X "errorlog", X "extend", X "fgl_drawbox", X "fgl_keyval", X "fgl_lastkey", X "field_touched", X "fraction", X "get_fldbuf", X "if", X "infield", X "key", X "length", X "max", X "mdy", X "min", X "month", X "num_args", X "or", X "ord", X "percent", X "return", X "scr_line", X "select", X "set_count", X "showhelp", X "startlog", X "sum", X "union", X "upshift", X "values", X "varchar", X "weekday", X "when", X "where", X "while", X "year", X}; X X#define NBLTIN (sizeof builtin / sizeof(char *)) X Xstatic int Xbltincmp(const void *i1, const void *i2) X{ X return strcmp(*((char **) i1), *((char **) i2)); X} X Xstatic int Xbltin(char *ident) X{ X return !!bsearch(&ident, builtin, NBLTIN, sizeof(char *), bltincmp); X} X Xstatic char * Xuc_ident(char *ident) X{ X register char *s; X X for (s = ident; *s; s++) X *s = toupper(*s); X return ident; X} SHAR_EOF chmod 0644 'parser.y' || $echo 'restore of' 'parser.y' 'failed' # ============= read_pdbs.ec ============== $echo 'x -' extracting 'read_pdbs.ec' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'read_pdbs.ec' && X/* X * fgldoc, an Informix-4GL program documenter X * Copyright (c) 1995-1999 Ivan Nejgebauer X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X */ X X#include "config.h" X#include X#include X#include X XEXEC SQL include sqlca; XEXEC SQL include sqltypes; X Xread_progdbs(pname, mod_reg_func) X char *pname; X int (*mod_reg_func)(); X{ X char *pdbs; X X EXEC SQL BEGIN DECLARE SECTION; X char dbname[19]; X char progname[11]; X string modname[11]; X string modpath[41]; X EXEC SQL END DECLARE SECTION; X X dbname[sizeof dbname - 1] = '\0'; X if ((pdbs = getenv("PROGRAM_DESIGN_DBS")) != NULL) X strncpy(dbname, pdbs, sizeof dbname - 1); X else X strcpy(dbname, "syspgm4gl"); X progname[sizeof progname - 1] = '\0'; X strncpy(progname, pname, sizeof progname - 1); X X EXEC SQL whenever sqlerror call bail_out; X X EXEC SQL database :dbname; X X EXEC SQL declare c_source cursor for X select fglsourcename, spath into :modname, :modpath from source4gl X where progname = :progname and fglsourcename is not null; X EXEC SQL open c_source; X while (1) { X EXEC SQL fetch c_source; X if (SQLCODE != 0) X break; X mod_reg_func(modname, risnull(SQLCHAR, modpath) ? "." : modpath); X } X EXEC SQL close c_source; X EXEC SQL free c_source; X X EXEC SQL whenever sqlerror goto no_consequence; X X EXEC SQL declare c_global cursor for X select globname, gpath into :modname, :modpath from global X where progname = :progname and globname is not null; X EXEC SQL open c_global; X while (1) { X EXEC SQL fetch c_global; X if (SQLCODE != 0) X break; X mod_reg_func(modname, risnull(SQLCHAR, modpath) ? "." : modpath); X } X EXEC SQL close c_global; X EXEC SQL free c_global; X Xno_consequence: X EXEC SQL close database; X} X X#define MBUFSIZE 1024 /* error message buffer size */ X X#define FATAL(msg) \ X fprintf(stderr, "Fatal error trying to report SQL error %d:\n%s.\n", \ X SQLCODE, msg) X X#ifdef HAVE_RGETLMSG X#define MSGFUNC rgetlmsg X#define GETMSG(code) MSGFUNC(code, mbuf, MBUFSIZE, &msglen) X#else X#define MSGFUNC rgetmsg X#define GETMSG(code) MSGFUNC(code, mbuf, (short) MBUFSIZE) X#endif X Xbail_out() X{ X char mbuf[MBUFSIZE]; X int msglen; X int gmerr; X X switch (gmerr = GETMSG(SQLCODE)) { X case 0: X break; X case -1227: X FATAL("Error number -1227:\nMessage file not found."); X break; X case -1228: X FATAL("Error number -1228:\nMessage number not found in message file."); X break; X case -1231: X FATAL("Error number -1231:\nCannot seek within message file."); X break; X case -1232: X FATAL("Error number -1232:\nMessage buffer too small."); X break; X default: X sprintf(mbuf, "Unknown error %d from %s()", gmerr, MSGFUNC); X FATAL(mbuf); X break; X } X X if (gmerr == 0) { X fprintf(stderr, "SQL statement error number %d.\n", SQLCODE); X fprintf(stderr, mbuf, sqlca.sqlerrm); X } X exit(1); X} SHAR_EOF chmod 0644 'read_pdbs.ec' || $echo 'restore of' 'read_pdbs.ec' 'failed' rm -fr _sh12320 exit 0