diff options
author | Karl Berry <karl@freefriends.org> | 2024-09-21 15:32:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-09-21 15:32:41 +0000 |
commit | c4a008f883567d9135045b30403bd4eb8dab9d0a (patch) | |
tree | 54b587512c80c148ce6f844c3eab3d67843e3daf | |
parent | b95cf36ba8fc2d474de2141e3a006ebe3c7540b2 (diff) |
sqltex (20sep24)
git-svn-id: svn://tug.org/texlive/trunk@72338 c570f23f-e606-0410-a88d-b1316a301751
45 files changed, 11744 insertions, 3 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index 0bd39fbab96..f067c8bf19c 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -223,6 +223,7 @@ texmf_other_scripts = \ runtexshebang/runtexshebang.lua \ spix/spix.py \ splitindex/splitindex.pl \ + sqltex/sqltex \ srcredact/srcredact.pl \ sty2dtx/sty2dtx.pl \ svn-multi/svn-multi.pl \ diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index 04b5c6d629b..00dff11ec3a 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -443,6 +443,7 @@ texmf_other_scripts = \ runtexshebang/runtexshebang.lua \ spix/spix.py \ splitindex/splitindex.pl \ + sqltex/sqltex \ srcredact/srcredact.pl \ sty2dtx/sty2dtx.pl \ svn-multi/svn-multi.pl \ diff --git a/Build/source/texk/texlive/linked_scripts/scripts.lst b/Build/source/texk/texlive/linked_scripts/scripts.lst index 04eacde6e68..0e38f324aac 100644 --- a/Build/source/texk/texlive/linked_scripts/scripts.lst +++ b/Build/source/texk/texlive/linked_scripts/scripts.lst @@ -164,6 +164,7 @@ rubik/rubikrotation.pl runtexshebang/runtexshebang.lua spix/spix.py splitindex/splitindex.pl +sqltex/sqltex srcredact/srcredact.pl sty2dtx/sty2dtx.pl svn-multi/svn-multi.pl diff --git a/Build/source/texk/texlive/linked_scripts/sqltex/sqltex b/Build/source/texk/texlive/linked_scripts/sqltex/sqltex new file mode 100755 index 00000000000..ea612c790f2 --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/sqltex/sqltex @@ -0,0 +1,1381 @@ +#!/usr/bin/env perl + +# To disable support for the --configfile option, set the value below to 0. +$main::ext_cfgfile_allowed = 1; + +################################################################################ +# +# SQLTeX - SQL preprocessor for Latex +# +# File: sqltex +# ===== +# +# Purpose: This script is a preprocessor for LaTeX. It reads a LaTeX file +# ======== containing SQL commands, and replaces them their values. +# +# This software is subject to the terms of the LaTeX Project Public License; +# see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html. +# +# Copyright: (c) 2001-2024, Oscar van Eijk, Oveas Functionality Provider +# ========== oscar@oveas.com +# This software is subject to the terms of the LaTeX Project Public License; +# see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html +# +# History: +# ======== +# v1.3 Mar 16, 2001 (Initial release) +# v1.4 May 2, 2002 +# v1.4.1 Feb 15, 2005 +# v1.5 Nov 23, 2007 +# v2.0 Jan 12, 2016 +# v2.1 Jan 21, 2022 +# v2.1-1 Apr 19, 2022 (test version for MSSQL, no official release) +# v2.1-2 Jun 25, 2023 (test version parameter in sql_setparams(), no official release) +# v2.1-3 Nov 30, 2023 (test version \sqlif-\sqlendif & \sqlsystem, no official release) +# v2.2 Jul 31, 2024 +# v3.0 Sep 20, 202x +# Refer to the documentation for changes per release +# +# TODO: +# ===== +# Code is getting messy - too many globals: rewrite required +# +################################################################################ +# +#use strict; +use DBI; +use Getopt::Long; +Getopt::Long::Configure ("bundling"); +use Cwd; +use feature 'state'; + +$main::ReadKey_available = eval +{ + require Term::ReadKey; + Term::ReadKey->import(); + 1; +}; + +##### +# Find out if any command-line options have been given +# Parse them using 'Getopt' +# +sub parse_options { + + $main::NULLallowed = 0; + + if (!GetOptions('help|h|?' => \$main::options{'h'} + , 'configfile|c=s' => \$main::options{'c'} + , 'replacementfile|r=s' => \$main::options{'r'} + , 'no-replacementfile|R' => \$main::options{'R'} + , 'output|o=s' => \$main::options{'o'} + , 'skip-empty-lines|-S' => \$main::options{'S'} + , 'write-comments|-C' => \$main::options{'C'} + , 'filename-extend|e=s' => \$main::options{'e'} + , 'file-extension|E=s' => \$main::options{'E'} + , 'sqlserver|s=s' => \$main::options{'s'} + , 'username|U=s' => \$main::options{'U'} + , 'password|P:s' => \$main::options{'P'} + , 'null-allowed|N' => \$main::options{'N'} + , 'version|V' => \$main::options{'V'} + , 'force|f' => \$main::options{'f'} + , 'quiet|q' => \$main::options{'q'} + , 'multidoc-numbered|m' => \$main::options{'m'} + , 'multidoc-named|M' => \$main::options{'M'} + , 'prefix|p=s' => \$main::options{'p'} + , 'use-local-config|l' => \$main::options{'l'} + , 'updates|u' => \$main::options{'u'} + )) { + print "usage: sqltex [options] <file[.$main::configuration{'texex'}]> [parameter...]\n" + . " type \"sqltex --help\" for help\n"; + exit(1); + } + + if (defined $main::options{'h'}) { + &print_help; + exit(0); + } + if (defined $main::options{'V'}) { + &print_version; + exit(0); + } + + my $optcheck = 0; + $optcheck++ if (defined $main::options{'E'}); + $optcheck++ if (defined $main::options{'e'}); + $optcheck++ if (defined $main::options{'o'}); + die ("options \"-E\", \"-e\" and \"-o\" cannot be combined\n") if ($optcheck > 1); + + $optcheck = 0; + $optcheck++ if (defined $main::options{'m'}); + $optcheck++ if (defined $main::options{'M'}); + $optcheck++ if (defined $main::options{'o'}); + die ("options \"-m\", \"-M\" and \"-o\" cannot be combined\n") if ($optcheck > 1); + + $optcheck = 0; + $optcheck++ if (defined $main::options{'r'}); + $optcheck++ if (defined $main::options{'R'}); + die ("options \"-r\" and \"-R\" cannot be combined\n") if ($optcheck > 1); + + $main::NULLallowed = 1 if (defined $main::options{'N'}); + $main::configuration{'cmd_prefix'} = $main::options{'p'} if (defined $main::options{'p'}); + + $main::multidoc_cnt = 0; + $main::multidoc = (defined $main::options{'m'} || defined $main::options{'M'}); + $main::multidoc_id = ''; + + if ($main::multidoc) { + $main::multidoc_id = '_#M#'; + if (defined $main::options{'M'}) { + $main::multidoc_id = '_#P#' + } + } + + if (defined $main::options{'l'}) { + warn "Option '-l' is obsolete, use '-c <location>' instead"; + delete $main::options{'l'}; + } +} + +##### +# Print the Usage: line on errors and after the '-h' switch +# +sub short_help ($) { + my $onerror = shift; + my $helptext = "usage: sqltex [options] <file[.$main::configuration{'texex'}]> [parameter...]\n"; + $helptext .= " type \"sqltex -h\" for help\n" if ($onerror); + return ($helptext); +} + + +##### +# Print full help and after the '-h' switch +# +sub print_help { + my $helptext = &short_help (0); + + $helptext .= " Options:\n"; + if ($main::ext_cfgfile_allowed) { + $helptext .= " --configfile <file>\n"; + $helptext .= " -c <file>\n"; + $helptext .= " SQLTeX configuration file.\n"; + $helptext .= " Default is \'$main::config_location/SQLTeX.cfg\'.\n\n"; + } + $helptext .= " --file-extension <string>\n"; + $helptext .= " -E <string>\n"; + $helptext .= " replace input file extension in outputfile:\n"; + $helptext .= " \'input.tex\' will be \'input.string\'\n"; + $helptext .= " For further notes, see option \'--filename-extend\' below\n\n"; + + $helptext .= " --null-allowed\n"; + $helptext .= " -N\n"; + $helptext .= " NULL return values allowed. By default SQLTeX exits if a\n"; + $helptext .= " query returns an empty set\n\n"; + + $helptext .= " --password [password]\n"; + $helptext .= " -P [password]\n"; + $helptext .= " database password. The value is optional; if omitted, SQLTeX will prompt for\n"; + $helptext .= " a password. This overwrites the password in the input file.\n\n"; + + $helptext .= " --username <user>\n"; + $helptext .= " -U <user>\n"; + $helptext .= " database username\n\n"; + + $helptext .= " --version\n"; + $helptext .= " -V\n"; + $helptext .= " print version number and exit\n\n"; + + $helptext .= " --filename-extend <string>\n"; + $helptext .= " -e <string>\n"; + $helptext .= " add string to the output filename:\n"; + $helptext .= " \'input.tex\' will be \'inputstring.tex\'\n"; + $helptext .= " In \'string\', the values between curly braces \{\}\n"; + $helptext .= " will be substituted:\n"; + $helptext .= " Pn parameter n\n"; + $helptext .= " M current monthname (Mon)\n"; + $helptext .= " W current weekday (Wdy)\n"; + $helptext .= " D current date (yyyymmdd)\n"; + $helptext .= " DT current date and time (yyyymmddhhmmss)\n"; + $helptext .= " T current time (hhmmss)\n"; + $helptext .= " e.g., the command \'sqltex --filename-extend _{P1}_{W} my_file code\'\n"; + $helptext .= " will read \'my_file.tex\' and write \'myfile_code_Tue.tex\'\n"; + $helptext .= " The same command, but with option \--file-extension\' would create the\n"; + $helptext .= " outputfile \'myfile._code_Tue\'\n"; + $helptext .= " By default the outputfile \'myfile_stx.tex\' would have been written.\n"; + $helptext .= " The options \'--file-extension\' and \'--filename-extend\' cannot be used\n"; + $helptext .= " together or with \'--output\'.\n\n"; + + $helptext .= " --force\n"; + $helptext .= " -f\n"; + $helptext .= " force overwrite of existing files\n\n"; + + $helptext .= " --help\n"; + $helptext .= " -h\n"; + $helptext .= " print this help message and exit\n\n"; + + $helptext .= " --multidoc-numbered\n"; + $helptext .= " -m\n"; + $helptext .= " Multidocument mode; create one document for each parameter that is retrieved\n"; + $helptext .= " from the database in the input document (see documentation)\n"; + $helptext .= " This option cannot be used with \'--output\'.\n\n"; + + $helptext .= " --multidoc-named\n"; + $helptext .= " -M\n"; + $helptext .= " Same as -m, but with the parameter in the filename i.s.o. a serial number\n\n"; + + $helptext .= " --output <file>\n"; + $helptext .= " -o <file>\n"; + $helptext .= " specify an output file. Cannot be used with \'--file-extension\',\n"; + $helptext .= " \'--filename-extend\' or the \'--multidoc\' options.\n\n"; + + $helptext .= " --skip-empty-lines\n"; + $helptext .= " -S\n"; + $helptext .= " All SQLTeX commands will be removed from the input line or replaced by the\n"; + $helptext .= " corresponding value. The rest of the input line is written to the output file.\n"; + $helptext .= " This includes lines that only contain a SQLTeX command (and a newline character).\n"; + $helptext .= " This will result in an empty line in the output file.\n"; + $helptext .= " By specifying this option, these empty lines will be skipped. Lines that were empty\n"; + $helptext .= " in the input will be written.\n\n"; + + $helptext .= " --write-comments\n"; + $helptext .= " -C\n"; + $helptext .= " LaTeX comments in the input file will be skipped by default. With this option,\n"; + $helptext .= " comments will also be copied to the output file.\n\n"; + + $helptext .= " --prefix <prefix>\n"; + $helptext .= " -p <prefix>\n"; + $helptext .= " prefix used in the SQLTeX file. Default is \'sql\'\n"; + $helptext .= " (e.g. \\sqldb[user]{database}), but this can be overwritten if it conflicts\n"; + $helptext .= " with other user-defined commands.\n\n"; + + $helptext .= " --quiet\n"; + $helptext .= " -q\n"; + $helptext .= " run in quiet mode\n\n"; + + $helptext .= " --replacementfile <file>\n"; + $helptext .= " -r <file>\n"; + $helptext .= " specify a file that contains replace characters. This is a list with two tab-separated\n"; + $helptext .= " fields per line. The first field holds a string that will be replaced in the SQL output\n"; + $helptext .= " by the second string.\n"; + $helptext .= " By default the file \'$main::config_location/SQLTeX_r.dat\' is used.\n"; + $helptext .= " This default file will still be read after the given replacement file, unless support for\n"; + $helptext .= " multiple replacement files is disabled in the configuration.\n\n"; + + $helptext .= " --no-replacementfile\n"; + $helptext .= " -R\n"; + $helptext .= " do not use a replace file. \'--replacementfile\' \'--no-replacementfile\' are handled\n"; + $helptext .= " in the same order as they appear on the command line.\n"; + $helptext .= " For backwards compatibility, -rn is also still supported.\n\n"; + + $helptext .= " --sqlserver <server>\n"; + $helptext .= " -s <server>\n"; + $helptext .= " SQL server to connect to. Default is \'localhost\'\n\n"; + + $helptext .= " --updates\n"; + $helptext .= " -u\n"; + $helptext .= " If the input file contains updates, execute them.\n\n"; + + $helptext .= " file is the input file that should be read. By default,\n"; + $helptext .= " sqltex looks for a file with extension \'.$main::configuration{'texex'}\'.\n\n"; + $helptext .= " parameter(s) are substituted in the SQL statements if they contain\n"; + $helptext .= " the string \$PAR[x] somewhere in the statement, where\n"; + $helptext .= " \'x\' is the number of the parameter.\n"; + + print $helptext; +} + +##### +# Print the version number +# +sub print_version { + print "sqltex v$main::version - $main::rdate\n"; +} + +##### +# If we're not running in quiet mode (-q), this routine prints a message telling +# the user what's going on. +# +sub print_message ($) { + my $message = shift; + print "$message\n" unless (defined $main::options{'q'}); +} + + +##### +# If we have to prompt for a password, disable terminal echo, get the password +# and return it to the caller +# +sub get_password ($$) { + my ($usr, $srv) = @_; + + my $pwd = ""; + + my $q = "Password for $usr\@$srv : "; + if ($main::ReadKey_available) { + print $q; + ReadMode(4); + while(ord(my $keyStroke = ReadKey(0)) != 10) { + if(ord($keyStroke) == 127 || ord($keyStroke) == 8) { # DEL/Backspace + chop($pwd); + print "\b \b"; + } elsif(ord($keyStroke) >= 32) { # Skip control characters + $pwd = $pwd . $keyStroke; + print '*'; + } + } + ReadMode(0); + print "\n"; + } else { + if ($main::configuration{'allow_readable_pwd'}) { + print $q; + $pwd = <STDIN>; + chomp $pwd; + } else { + die "Cannot ask for password. Either install the Term::ReadKey module or set 'allow_readable_pwd' to 1 in the configuration"; + } + } + return $pwd; +} + +##### +# If we have to prompt for a user. Get it and return it to the caller +# +sub get_username ($) { + my $srv = shift; + + print "Username at $srv : "; + + my $usr = <STDIN>; + chomp $usr; + return $usr; +} + + +####### +# Find the file extension for the outputfile +# +sub file_extension ($) { + my $subst = shift; + + my %mn = ('Jan','01', 'Feb','02', 'Mar','03', 'Apr','04', + 'May','05', 'Jun','06', 'Jul','07', 'Aug','08', + 'Sep','09', 'Oct','10', 'Nov','11', 'Dec','12' ); + my $sydate = localtime (time); + my ($wday, $mname, $dnum, $time, $year) = split(/\s+/,$sydate); + $dnum = "0$dnum" if ($dnum < 10); + while ($subst =~ /\{[a-zA-Z0-9]+\}/) { + my $s1 = $`; + my $sub = $&; + my $s2 = $'; + $sub =~ s/[\{\}]//g; + if ($sub =~ /P[0-9]/) { + $sub =~ s/P//; + die ("insufficient parameters to substitute \{P$sub\}\n") if ($sub > $#ARGV); + $sub = $ARGV[$sub]; + } elsif ($sub eq 'M') { + $sub = $mname; + } elsif ($sub eq 'W') { + $sub = $wday; + } elsif ($sub eq 'D') { + $sub = "$year$mn{$mname}$dnum"; + } elsif ($sub eq 'DT') { + $sub = "$year$mn{$mname}$dnum$time"; + $sub =~ s/://g; + } elsif ($sub eq 'T') { + $sub = $time; + $sub =~ s/://g; + } else { + die ("unknown substitution code \{$sub\}\n"); + } + $subst = "$s1$sub$s2"; + } + return ($subst); +} + +##### +# Find the configuration files +# +sub get_configfiles { + if (defined $main::options{'c'}) { + if (!$main::ext_cfgfile_allowed) { + die "Use of the --configfile option is disallowed by your system administrator"; + } + $main::configurationfile = $main::options{'c'}; + } else { + $main::configurationfile = $main::config_location + . ($main::config_location eq '' ? '' : '/') + . 'SQLTeX.cfg'; + } + if (!-e $main::configurationfile) { + die ("Configfile $main::configurationfile does not exist\n"); + } + + @main::replacefiles = (); + if (!defined $main::options{'R'} && $main::options{'r'} ne "n") { + my $std_replacefile = $main::config_location + . ($main::config_location eq '' ? '' : '/') . 'SQLTeX_r.dat'; + if (!-e $std_replacefile) { + warn ("replace file $std_replacefile does not exist\n"); + $std_replacefile = ""; + } + my $adl_replacefile = ""; + if (defined $main::options{'r'}) { + if (!-e $main::options{'r'}) { + warn ("replace file $main::options{'r'} does not exist\n"); + } else { + $adl_replacefile = $main::options{'r'}; + } + } + my $rf_cnt = 0; + if ($adl_replacefile ne "") { + $main::replacefiles[$rf_cnt++] = $adl_replacefile; + } + if ($std_replacefile ne "") { + $main::replacefiles[$rf_cnt++] = $std_replacefile; + } + } + + return; +} + +##### +# Declare the filenames to use in this run. +# If a file has been entered +# +sub get_filenames { + $main::inputfile = $ARGV[0] || die "no input file specified\n"; + + $main::path = ''; + while ($main::inputfile =~ /\//) { + $main::path .= "$`/"; + $main::inputfile =~ s/$`\///; + } + if ($main::inputfile =~/\./) { + if ((!-e "$main::path$main::inputfile") && (-e "$main::path$main::inputfile.$main::configuration{'texex'}")) { + $main::inputfile .= ".$main::configuration{'texex'}"; + } + } else { + $main::inputfile .= ".$main::configuration{'texex'}" + } + die "File $main::path$main::inputfile does not exist\n" if (!-e "$main::path$main::inputfile"); + + if (!defined $main::options{'o'}) { + $main::inputfile =~ /\./; + $main::outputfile = "$`"; + my $lastext = "$'"; + while ($' =~ /\./) { + $main::outputfile .= ".$`"; + $lastext = "$'"; + } + if (defined $main::options{'E'} || defined $main::options{'e'}) { + $main::configuration{'stx'} = &file_extension ($main::options{'E'} || $main::options{'e'}); + } + if (defined $main::options{'E'}) { + $main::outputfile .= "$main::multidoc_id.$main::configuration{'stx'}"; + } else { + $main::outputfile .= "$main::configuration{'stx'}$main::multidoc_id\.$lastext"; + } + if ($main::configuration{'def_out_is_in'}) { + $main::outputfile = $main::path . $main::outputfile; + } + } else { + $main::outputfile = $main::options{'o'}; + if ($main::configuration{'def_out_is_in'} && !($main::outputfile =~ /\//)) { + $main::outputfile = $main::path . $main::outputfile; + } + } + + return; +} + +##### +# Trim functions +# +sub ltrim { my $s = shift; $s =~ s/^\s+//; return $s; } +sub rtrim { my $s = shift; $s =~ s/\s+$//; return $s; } +sub trim { my $s = shift; return ltrim(rtrim($s)); } + +####### +# Connect to the database +# +sub db_connect($$) { + my ($up, $db) = @_; + state $data_source; + state $gotInput = 0; + + $main::line =~ s/(\[.*?\])?\{$db\}//; + + state $un = ''; + state $pw = ''; + state $hn = ''; + + if (!$gotInput) { + my @opts = split(',', $up); + for(my $idx = 0; $idx <= $#opts; $idx++) { + my $opt = $opts[$idx]; + if ($opt =~ /=/) { + if ($` eq 'user') { + $un = $'; + } elsif ($` eq 'passwd') { + $pw = $'; + } elsif ($` eq 'host') { + $hn = $'; + } + } else { + if ($idx == 0) { + $un = $opt; + } elsif ($idx == 1) { + $pw = $opt; + } elsif ($idx == 2) { + $hn = $opt; + } + } + } + + $un = $main::options{'U'} if (defined $main::options{'U'}); + $un = &get_username($main::options{'s'} || 'localhost') if ($un eq '?'); + + my $promptForPwd = 0; + if (defined $main::options{'P'}) { + if ($main::options{'P'} eq '') { + $promptForPwd = 1; + } else { + $pw = $main::options{'P'} + } + } + if ($pw eq '?') { + $promptForPwd = 1; + } + $pw = &get_password ($un, $main::options{'s'} || 'localhost') if ($promptForPwd); + $gotInput = 1; + + $hn = $main::options{'s'} if (defined $main::options{'s'}); + + if ($main::configuration{'dbdriver'} eq "Pg") { + $data_source = "DBI:$main::configuration{'dbdriver'}:dbname=$db"; + $data_source .= ";host=$hn" unless ($hn eq ""); + } elsif ($main::configuration{'dbdriver'} eq "Oracle") { + $data_source = "DBI:$main::configuration{'dbdriver'}:$db"; + $data_source .= ";host=$hn;sid=$main::configuration{'oracle_sid'}" unless ($hn eq ""); + $data_source .= ";sid=$main::configuration{'oracle_sid'}"; + } elsif ($main::configuration{'dbdriver'} eq "Ingres") { + $data_source = "DBI:$main::configuration{'dbdriver'}"; + $data_source .= ":$hn" unless ($hn eq ""); + $data_source .= ":$db"; + } elsif ($main::configuration{'dbdriver'} eq "Sybase") { + $data_source = "DBI:$main::configuration{'dbdriver'}:$db"; + $data_source .= ";server=$hn" unless ($hn eq ""); + } elsif ($main::configuration{'dbdriver'} eq "ODBC") { + if (!exists ($main::configuration{'odbc_driver'})) { + $main::configuration{'odbc_driver'} = 'SQL Server'; + } + if ($hn eq "") { + $hn = 'localhost'; + } + $data_source = "DBI:ODBC:Driver={$main::configuration{'odbc_driver'}};Server=$hn"; + $data_source .= ";Database=$db"; + $data_source .= ";UID=$un" unless ($un eq ""); + $data_source .= ";PWD=$pw" unless ($pw eq ""); + } else { # MySQL, mSQL, ... + $data_source = "DBI:$main::configuration{'dbdriver'}:database=$db"; + $data_source .= ";host=$hn" unless ($hn eq ""); + } + } + if (!defined $main::options{'q'}) { + my $msg = "Connect to database $db on "; + $msg .= $hn || 'localhost'; + $msg .= " as user $un" unless ($un eq ''); + $msg .= " using a password" unless ($pw eq ''); + &print_message ($msg); + } + if ($main::configuration{'sqlsystem_allowed'}) { + %main::connect_info = ( + 'hn' => $hn + ,'un' => $un + ,'pw' => $pw + ,'db' => $db + ); + } + $main::db_handle = DBI->connect ($data_source, $un, $pw, { RaiseError => 0, PrintError => 1 }) || &signal_message (1); + return; +} + +##### +# Check if the SQL statement contains options +# Supported options are: +# setvar=<i>, where <i> is the list location to store the variable. +# setarr=<i> +# +sub check_options ($) { + my $options = shift; + return if ($options eq ''); + $options =~ s/\[//; + $options =~ s/\]//; + + my @optionlist = split /,/, $options; + while (@optionlist) { + my $opt = shift @optionlist; + if ($opt =~ /^setvar=/i) { + $main::var_no = $'; + $main::setvar = 1; + } + if ($opt =~ /^setarr=/i) { + $main::arr_no = $'; + $main::setarr = 1; + } + if ($opt =~ /^fldsep=/i) { + $main::fldsep = qq{$'}; + $main::fldsep =~ s/NEWLINE/\n/; + } + if ($opt =~ /^rowsep=/i) { + $main::rowsep = qq{$'}; + $main::rowsep =~ s/NEWLINE/\n/; + } + } +} + +##### +# Replace values from the query result as specified in the replace files. +# This is done in two steps, to prevent characters from being replaces again +# if they occus both as key and as value. +# +sub replace_values ($) { + my $sqlresult = shift; + my $rk; + + foreach $rk (@main::repl_order) { + my ($begin, $end) = split /\Q$main::configuration{'rfile_regexploc'}\E/,$main::configuration{'rfile_regexp'}; + if ($rk =~ /^\Q$begin\E(.*)\Q$end\E$/) { + $sqlresult =~ s/$1/$main::repl_key{$rk}/g; + } else { + $sqlresult =~ s/\Q$rk\E/$main::repl_key{$rk}/g; + } + } + + foreach $rk (keys %main::repl_key) { + $sqlresult =~ s/$main::repl_key{$rk}/$main::repl_val{$main::repl_key{$rk}}/g; + } + return ($sqlresult); +} + +##### +# Select multiple rows from the database. This function can have +# the [fldsep=s] and [rowsep=s] options to define the string which +# should be used to separate the fields and rows. +# By default, fields are separated with a comma and blank (', '), and rows +# are separated with a newline character ('\\') +# +sub sql_row ($$) { + my ($options, $query) = @_; + local $main::fldsep = ', '; + local $main::rowsep = "\\\\"; + local $main::setarr = 0; + my (@values, @return_values, $rc, $fc); + + &check_options ($options); + + &print_message ("Retrieving row(s) with \"$query\""); + $main::sql_statements++; + my $stat_handle = $main::db_handle->prepare ($query); + $stat_handle->execute (); + + if ($main::setarr) { + &signal_message (7) if (defined $main::arr[$main::arr_no] && !$main::multidoc); + @main::arr[$main::arr_no] = (); + while (my $ref = $stat_handle->fetchrow_hashref()) { + foreach my $k (keys %$ref) { + $ref->{$k} = replace_values ($ref->{$k}); + } + push @{$main::arr[$main::arr_no]},$ref; + } + $stat_handle->finish (); + return (); + } + + while (@values = $stat_handle->fetchrow_array ()) { + $fc = $#values + 1; + if ($#main::replacefiles >= 0) { + my $list_cnt = 0; + foreach (@values) { + $values[$list_cnt] = replace_values ($values[$list_cnt]); + $list_cnt++; + } + } + push @return_values, (join "$main::fldsep", @values); + } + $stat_handle->finish (); + + if ($#return_values < 0) { + &signal_message (4); + } + + $rc = $#return_values + 1; + if ($rc == 1) { + &print_message ("Found $rc row with $fc field(s)"); + } else { + &print_message ("Found $rc rows with $fc fields each"); + } + + return (join "$main::rowsep", @return_values); + +} + + +##### +# Select a single field from the database. This function can have +# the [setvar=n] option to define an internal variable +# +sub sql_field ($$) { + my ($options, $query) = @_; + local $main::setvar = 0; + + &check_options ($options); + + $main::sql_statements++; + + &print_message ("Retrieving field with \"$query\""); + my $stat_handle = $main::db_handle->prepare ($query); + $stat_handle->execute (); + my @result = $stat_handle->fetchrow_array (); + $stat_handle->finish (); + + if ($#result < 0) { + &signal_message (4); + } elsif ($#result > 0) { + &signal_message (5); + } else { + &print_message ("Found 1 value: \"$result[0]\""); + if ($main::setvar) { + &signal_message (7) if (defined $main::var[$main::var_no] && !$main::multidoc); + $main::var[$main::var_no] = $result[0]; + return ''; + } else { + if ($#main::replacefiles >= 0) { + return (replace_values ($result[0])); + } else { + return ($result[0]); + } + } + } +} + +##### +# Start a section that will be repeated for evey row that is on stack +# +sub sql_start ($) { + my $arr_no = shift; + &signal_message (11) if (!defined $main::arr[$arr_no]); + if (@main::current_array) { + @main::current_array = (); + } + @main::loop_data = (); + push @main::current_array,$arr_no; +} + +##### +# Use a named variable from the stack +# +sub sql_use ($$) { + my ($field, $loop) = @_; + my $return_value = $main::configuration{'no_such_used_fld'}; + if (defined $main::arr[$#main::current_array][$loop]->{$field}) { + $return_value = $main::arr[$#main::current_array][$loop]->{$field}; + } + return $return_value; + +} + + +##### +# Stop processing the current array +# +sub sql_end () { + my $result = ''; + + for (my $cnt = 0; $cnt <= $#{$main::arr[$#main::current_array]}; $cnt++) { + for (my $lines = 0; $lines < $#{$main::loop_data[$#main::current_array]}; $lines++) { + my $buffered_line = ${$main::loop_data[$#main::current_array]}[$lines]; + my $cmdPrefix = $main::configuration{'alt_cmd_prefix'}; + if ($buffered_line =~ s/\\$cmdPrefix$main::configuration{'sql_endif'}\{\}//) { + $main::if_enabled = 1; + } + if ($buffered_line =~ /\\$cmdPrefix$main::configuration{'sql_if'}/) { + my $lin1 = $`; + my $lin2 = $'; + $lin2 =~ s/^\{//; + $lin2 =~ /\}/; + my $statement = $`; + $lin2 = $'; + $main::if_enabled = &sql_if($statement, $cnt); + $buffered_line = $lin1; + if ($main::if_enabled) { + $buffered_line .= $lin2; + } + } + if (!$main::if_enabled) { + next; + } + while (($buffered_line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($buffered_line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) { + my $cmdfound = $&; + $cmdfound =~ s/\\//; + $cmdfound =~ s/\{/\\\{/; + + $buffered_line =~ /\\$cmdfound/; + my $lin1 = $`; + $buffered_line = $'; + $buffered_line =~ /\}/; + my $statement = $`; + my $lin2 = $'; + + if ($cmdfound =~ /$main::configuration{'sql_use'}/) { + $buffered_line = $lin1 . &sql_use($statement, $cnt) . $lin2; + } + } + if ($buffered_line =~ /\\$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_system'}/) { + my $cmdfound = $&; + $cmdfound =~ s/\\//; + $cmdfound =~ s/\{/\\\{/; + + $buffered_line =~ /\\$cmdfound/; + my $lin1 = $`; + $buffered_line = $'; + $buffered_line =~ /\}/; + my $statement = $`; + my $lin2 = $'; + $statement =~ s/^\{//; + + while ($buffered_line =~ /\\$main::configuration{'alt_cmd_prefix'}$main::configuration{'sql_use'}\{(\w+)\}/) { + my $usereplacement = &sql_use($1, $cnt); + $buffered_line =~ s/\\$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_use'}\{(\w+)\}/$usereplacement/; + } + if ($cmdfound =~ /$main::configuration{'sql_system'}/) { + $buffered_line = $lin1 . &sql_system($statement) . $lin2; + } + } + $result .= $buffered_line; + } + } + + pop @main::current_array; + return $result; +} + +##### +# Start a conditional block +# +sub sql_if ($$) { + my ($condition, $cnt) = @_; + if ($condition =~ /(&&|\|\|)/) { + my $c1 = &check_condition($`, $cnt); + my $c2 = &check_condition($', $cnt); + return eval("$c1 $& $c2"); + } else { + return &check_condition($condition, $cnt); + } +} + +##### +# Helper function for sql_if +# +sub check_condition ($$) { + my ($condition, $cnt) = @_; + $condition =~ /(==|!=|<|>|<=|>=)/; + + my $lval = $`; + my $rval = $'; + my $comparisson = $&; + $lval = &trim($lval); + $rval = &trim($rval); + + my $uf = &sql_use($lval, $cnt); + if ($uf ne $main::configuration{'no_such_used_fld'}) { + $lval = $uf; + } + $uf = &sql_use($rval, $cnt); + if ($uf ne $main::configuration{'no_such_used_fld'}) { + $rval = $uf; + } + + my $result = 0; + if ($comparisson eq "==") { + $result = ($lval == $rval); + } elsif ($comparisson eq '!=') { + $result = ($lval != $rval); + } elsif ($comparisson eq '<') { + $result = ($lval < $rval); + } elsif ($comparisson eq '>') { + $result = ($lval > $rval); + } elsif ($comparisson eq '<=') { + $result = ($lval <= $rval); + } elsif ($comparisson eq '>=') { + $result = ($lval >= $rval); + } + return $result; +} + +##### +# Select a list of rows from the database. Each row will be input +# for a document in multidocument mode. +# +sub sql_setparams ($$) { + my ($options, $query) = @_; + my (@values, @return_values); + + &check_options ($options); + + &print_message ("Retrieving parameter list with \"$query\""); + $main::sql_statements++; + my $stat_handle = $main::db_handle->prepare ($query); + $stat_handle->execute (); + + for (my $i = 0; @values = $stat_handle->fetchrow_array (); $i++) { + for ($j = 0; $j <= $#values; $j++) { + $return_values[$i][$j] = $values[$j]; + } + } + + $stat_handle->finish (); + + if ($#return_values < 0) { + &signal_message (8); + } + + &print_message ('Multidocument parameters found; ' . $#return_values+1 ." documents will be created: handle document $main::multidoc_cnt") unless ($main::multidoc_cnt == 0); + + return (@return_values); +} + + +##### +# Perform an update. +# +sub sql_update ($$) { + my ($options, $query) = @_; + local $main::setvar = 0; + + if (!defined $main::options{'u'}) { + &print_message ("Updates will be ignored"); + return; + } + &check_options ($options); + + &print_message ("Updating values with \"$query\""); + my $rc = $main::db_handle->do($query); + &print_message ("$rc rows updated"); +} + +#### +# Call an external script or system command +# +sub sql_system ($) { + my $cmd = shift; + + my $return_value = '\\textbf{use of the \\textbackslash sqlsystem command is disallowed in the configuration}'; + if ($main::configuration{'sqlsystem_allowed'}) { + $cmd =~ s/\<SRV\>/$main::connect_info{'hn'}/; + $cmd =~ s/\<USR\>/$main::connect_info{'un'}/; + $cmd =~ s/\<PWD\>/$main::connect_info{'pw'}/; + $cmd =~ s/\<DB\>/$main::connect_info{'db'}/; + $return_value = `$cmd`; + } + return $return_value; +} + +##### +# Simple error handling +# Files will be closed if opened, and if no sql output was written yet, +# the outputfile will be removed. +# +sub signal_message ($) { + my $step = shift; + my $can_continue = 0; + + $can_continue = 1 if ($step == 4 && $main::NULLallowed); + + if ($step >= 1 && $step <= 2 && !$can_continue) { + unlink ($main::outputfile); + } + + ##### + # Step specific exit + # + my $msg; + if ($step == 1) { + $msg = "noerror opening database at line $main::lcount[$main::fcount]"; + } elsif ($step == 2) { + $msg = "no database opened at line $main::lcount[$main::fcount]"; + } elsif ($step == 3) { + $msg = "insufficient parameters to substitute variable on line $main::lcount[$main::fcount]"; + } elsif ($step == 4) { + $msg = "no result set found on line $main::lcount[$main::fcount]"; + } elsif ($step == 5) { + $msg = "result set too big on line $main::lcount[$main::fcount]"; + } elsif ($step == 6) { + $msg = "trying to substitute with non existing on line $main::lcount[$main::fcount]"; + } elsif ($step == 7) { + $msg = "trying to overwrite an existing variable on line $main::lcount[$main::fcount]"; + } elsif ($step == 8) { + $msg = "no parameters for multidocument found on line $main::lcount[$main::fcount]"; +# } elsif ($step == 9) { +# $msg = "too many fields returned in multidocument mode on $main::lcount[$main::fcount]"; + } elsif ($step == 10) { + $msg = "unrecognized command on line $main::lcount[$main::fcount]"; + } elsif ($step == 11) { + $msg = "start using a non-existing array on line $main::lcount[$main::fcount]"; + } elsif ($step == 12) { + $msg = "\\sqluse command encountered outside loop context on line $main::lcount[$main::fcount]"; + } elsif ($step == 13) { + $msg = "\\sqlif command encountered outside loop context on line $main::lcount[$main::fcount]"; + } + if ($main::fcount > 0) { + for (my $fcnt = 0; $fcnt < $main::fcount; $fcnt++) { + $msg .= ', file included from line '.$main::lcount[$fcnt]; + } + } + warn "$msg\n"; + return if ($can_continue); + exit (1); +} + +##### +# An SQL statement was found in the input file. If multiple lines are +# used for this query, they will be read until the '}' is found, after which +# the query will be executed. +# +sub parse_command ($$$) { + my $cmdfound = shift; + my $multidoc_par = shift; + my $file_handle = shift; + my $options = ''; + my $varallowed = 1; + + $varallowed = 0 if ($cmdfound =~ /$main::configuration{'sql_open'}/); + + chop $cmdfound; + $cmdfound =~ s/\\//; + + $main::line =~ /\\$cmdfound/; + my $lin1 = $`; + $main::line = $'; + + while (!($main::line =~ /\}/)) { + chomp $main::line; + $main::line .= ' '; + $main::line .= <$file_handle>; + $main::lcount[$main::fcount]++; + } + + $main::line =~ /\}/; + my $statement = $`; + my $lin2 = $'; + + my $raw_statement = $statement; + $raw_statement =~ s/^\{//; + $statement =~ s/(\[|\{)//g; + if ($statement =~ /\]/) { + $options = $`; + $statement = $'; + } + if ($varallowed) { + if (($main::multidoc_cnt > 0) && $main::multidoc) { + for (my $i = 1; $i <= $#main::parameters; $i++) { + $statement =~ s/\$MPAR$i/$main::parameters[$main::multidoc_cnt-1][$i-1]/g; + } + } + for (my $i = 1; $i <= $#ARGV; $i++) { + $statement =~ s/\$PAR$i/$ARGV[$i]/g; + } + while ($statement =~ /\$VAR[0-9]/) { + my $varno = $&; + $varno =~ s/\$VAR//; + &signal_message (6) if (!defined ($main::var[$varno])); + $statement =~ s/\$VAR$varno/$main::var[$varno]/g; + } + if ($statement =~ /\$PAR/ && ($main::multidoc_cnt > 0) && $main::multidoc) { + print "Did you update your input file to reflect the changes in v2.2?\n"; + print "Multidoc parameters are now used to replace \$MPARn (was \$PARn).\n"; + print "Please check the documentation for more info.\n"; + die ("No parameters found to replace in multidoc mode"); + } + $statement =~ s/\{//; + } + + $cmdfound =~ s/^$main::configuration{'cmd_prefix'}//; + if ($cmdfound eq $main::configuration{'sql_open'} + ) { + &db_connect($options, $statement); + $main::db_opened = 1; + return 0; + } + + &signal_message (2) if (!$main::db_opened); + if ($cmdfound eq $main::configuration{'sql_field'}) { + $main::line = $lin1 . &sql_field($options, $statement) . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_row'}) { + $main::line = $lin1 . &sql_row($options, $statement) . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_params'}) { + if ($main::multidoc) { # Ignore otherwise + @main::parameters = &sql_setparams($options, $statement); + $main::line = $lin1 . $lin2; + return 1; # Finish this run + } else { + $main::line = $lin1 . $lin2; + } + } elsif ($cmdfound eq $main::configuration{'sql_update'}) { + &sql_update($options, $statement); + $main::line = $lin1 . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_start'}) { + &sql_start($statement); + $main::line = $lin1 . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_use'}) { + &signal_message (12) if (!@main::current_array); + $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_use'} . "{" . $statement . "}" . $lin2; # Restore the line, will be processed later + } elsif ($cmdfound eq $main::configuration{'sql_end'}) { + $main::line = $lin1 . &sql_end() . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_endif'}) { + $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_endif'} . "{}" . $lin2; # Restore the line, will be processed later + } elsif ($cmdfound eq $main::configuration{'sql_if'}) { + &signal_message (13) if (!@main::current_array); + $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_if'} . "{" . $statement . "}" . $lin2; # Restore the line, will be processed later + } elsif ($cmdfound =~ /$main::configuration{'sql_system'}/) { + $main::line = $lin1 . &sql_system($raw_statement) . $lin2; + } else { + &signal_message (10); + } + return 0; +} + +sub read_input($$$$) { + my ($input_file, $output_handle, $multidoc_par) = @_; + + $main::fcount++; + $main::lcount[$main::fcount] = 0; + + if (!-e $input_file) { + die "input file $input_file not found"; + } + print_message("Processing file $input_file..."); + open (my $fileIn, "<$input_file"); + + while ($main::line = <$fileIn>) { + $main::lcount[$main::fcount]++; + my $line_had_cmd = 0; + + if ($main::line =~ /^\s*%/) { + next if (!$main::options{'C'}); + } else { + if ($main::line =~ /(.*?)(\\in(put|clude))(\s*?)\{(.*?)\}(.*)/) { + print $output_handle "$1" unless ($output_handle == -1); + &read_input($5, $output_handle, $multidoc_par); + return if ($main::restart); + print $output_handle "$6\n" unless ($output_handle == -1); + } + my $cmdPrefix = $main::configuration{'cmd_prefix'}; + if (@main::current_array) { + # Inside loop context the \sqlsystem{} command can contain \sqluse{} + $main::line =~ s/$cmdPrefix$main::configuration{'sql_system'}/$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_system'}/; + } + while (($main::line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($main::line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) { + $line_had_cmd = 1; + if (&parse_command($&, $multidoc_par, $fileIn) && $main::multidoc && ($main::multidoc_cnt == 0)) { + close $fileIn; + $main::fcount--; + $main::restart = 1; + return; + } + } + } + next if ($line_had_cmd && $main::line eq "\n" && $main::options{'S'}); + + if (@main::current_array && $#main::current_array >= 0) { + push @{$main::loop_data[$#main::current_array]}, $main::line; + } else { + print $output_handle "$main::line" unless ($main::multidoc && ($main::multidoc_cnt == 0)); + } + } + $main::fcount--; + close $fileIn; +} + +##### +# Process the input file +# When multiple documents should be written, this routine is +# multiple times. +# The first time, it only builds a list with parameters that will be +# used for the next executions +# +sub process_file { + my $multidoc_par = ''; + + if ($main::multidoc && ($main::multidoc_cnt > 0)) { + if (!defined($main::saved_outfile_template)) { + $main::saved_outfile_template = $main::outputfile; + } + $main::saved_outfile_template = $main::outputfile if ($main::multidoc_cnt == 1); # New global name; should be a static + $main::outputfile = $main::saved_outfile_template if ($main::multidoc_cnt > 1); + $main::outputfile =~ s/\#M\#/$main::multidoc_cnt/; + $main::outputfile =~ s/\#P\#/$main::parameters[($main::multidoc_cnt-1)][0]/; + $multidoc_par = @main::parameters[$main::multidoc_cnt - 1]; + } + my $fileOut; + if ($main::multidoc && ($main::multidoc_cnt == 0)) { + $fileOut = -1; + } else { + open ($fileOut, ">$main::outputfile"); + } + + $main::sql_statements = 0; + $main::db_opened = 0; + $main::fcount = -1; + $main::restart = 0; + + &read_input($main::path . $main::inputfile, $fileOut, $multidoc_par); + + if ($main::multidoc) { + $main::multidoc = 0 if (($main::multidoc_cnt++) > $#main::parameters); + return if ($main::multidoc); + } + + close $fileOut; +} + +## Main: + +##### +# Default config values, can be overwritten with SQLTeX.cfg +# +%main::configuration = ( + 'dbdriver' => 'mysql' + ,'oracle_sid' => 'ORASID' + ,'texex' => 'tex' + ,'stx' => '_stx' + ,'def_out_is_in' => 0 + ,'rfile_comment' => ';' + ,'rfile_regexploc' => '...' + ,'rfile_regexp' => 're(...)' + ,'multi_rfile' => 1 + ,'cmd_prefix' => 'sql' + ,'sql_system' => 'system' + ,'sql_open' => 'db' + ,'sql_field' => 'field' + ,'sql_row' => 'row' + ,'sql_params' => 'setparams' + ,'sql_update' => 'update' + ,'sql_start' => 'start' + ,'sql_end' => 'end' + ,'sql_use' => 'use' + ,'sql_if' => 'if' + ,'sql_endif' => 'endif' + ,'sqlsystem_allowed' => 0 + ,'allow_readable_pwd'=> 0 + ,'repl_step' => 'OSTX' + ,'alt_cmd_prefix' => 'processedsqlcommand' + ,'last_cmd_prefix' => 'lastsqlcommand' + ,'no_such_used_fld' => '\textit{SQL\TeX\ use-field does not exist}' +); + +##### +# Some globals +# +{ + my $realpath = Cwd::realpath($0); + + my @dir_list = split /\//, $realpath; + pop @dir_list; + $main::my_location = join '/', @dir_list; + $main::if_enabled = 1; + + if ($main::my_location =~ /texmf-dist\/scripts/) { + # Config location in a TeX Live distro + $main::config_location = $main::my_location; + } else { + if ($^O eq "linux") { + # Default on linux, can be changed when running configure + $main::config_location = '/usr/local/etc'; + } else { + # Default on al other OSes + $main::config_location = $main::my_location; + } + } +} + +$main::version = '3.0'; +$main::rdate = 'Sep 20, 2024'; + +&parse_options; +&get_configfiles; + +if (defined $main::configurationfile) { + open (CF, "<$main::configurationfile"); + while ($main::line = <CF>) { + next if ($main::line =~ /^\s*#/); + next if ($main::line =~ /^\s*$/); + chomp $main::line; + my ($ck, $cv) = split /=/, $main::line, 2; + $ck =~ s/\s//g; + $cv =~ s/\s//g; + if ($cv ne '') { + $main::configuration{$ck} = $cv; + } + } + close CF; +} + +# Check config +# Used for loops, should not start with $main::configuration{'cmd_prefix'} !! +if ($main::configuration{'alt_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/ + || $main::configuration{'last_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/) { + die "Configuration items 'alt_cmd_prefix' and ĺast_cnd_prefix' cannot start with $main::configuration{'cmd_prefix'}"; +} + +&get_filenames; + +if (!$main::multidoc && -e "$main::outputfile") { + die ("outputfile $main::outputfile already exists\n") + unless (defined $main::options{'f'}); +} + +{ + my $repl_cnt = '000'; + @main::repl_order = (); + for (my $rf_cnt = 0; $rf_cnt <= $#main::replacefiles; $rf_cnt++) { + open (RF, "<$main::replacefiles[$rf_cnt]"); + while ($main::line = <RF>) { + next if ($main::line =~ /^\s*$main::configuration{'rfile_comment'}/); + chomp $main::line; + $main::line =~ s/\t+/\t/; + my ($rk, $rv) = split /\t/, $main::line; + if ($rk ne '') { + push @main::repl_order, $rk; + $main::repl_key{$rk} = "$main::configuration{'repl_step'}$repl_cnt"; + $main::repl_val{"$main::configuration{'repl_step'}$repl_cnt"} = $rv; + $repl_cnt++; + } + } + close RF; + if (!$main::configuration{'multi_rfile'}) { + last; + } + } +} + +# Start processing +do { + &process_file; + $main::restart = 0; + if ($main::sql_statements == 0) { + unlink ("$main::outputfile"); + print "no sql statements found in $main::path$main::inputfile\n"; + $main::multidoc = 0; # Problem in the input, useless to continue + } else { + print "$main::sql_statements queries executed - TeX file $main::outputfile written\n" + unless ($main::multidoc && ($main::multidoc_cnt == 1)); + } +} while ($main::multidoc); # Set to false when done + +$main::db_handle->disconnect() if ($main::db_opened); +exit (0); + +# +# And that's about it. +##### diff --git a/Master/bin/aarch64-linux/sqltex b/Master/bin/aarch64-linux/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/aarch64-linux/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/amd64-freebsd/sqltex b/Master/bin/amd64-freebsd/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/amd64-freebsd/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/amd64-netbsd/sqltex b/Master/bin/amd64-netbsd/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/amd64-netbsd/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/armhf-linux/sqltex b/Master/bin/armhf-linux/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/armhf-linux/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/i386-freebsd/sqltex b/Master/bin/i386-freebsd/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/i386-freebsd/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/i386-linux/sqltex b/Master/bin/i386-linux/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/i386-linux/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/i386-netbsd/sqltex b/Master/bin/i386-netbsd/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/i386-netbsd/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/i386-solaris/sqltex b/Master/bin/i386-solaris/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/i386-solaris/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/universal-darwin/sqltex b/Master/bin/universal-darwin/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/universal-darwin/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/windows/sqltex.exe b/Master/bin/windows/sqltex.exe Binary files differnew file mode 100755 index 00000000000..3332231b08c --- /dev/null +++ b/Master/bin/windows/sqltex.exe diff --git a/Master/bin/x86_64-cygwin/sqltex b/Master/bin/x86_64-cygwin/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/x86_64-cygwin/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/x86_64-darwinlegacy/sqltex b/Master/bin/x86_64-darwinlegacy/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/x86_64-darwinlegacy/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/x86_64-linux/sqltex b/Master/bin/x86_64-linux/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/x86_64-linux/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/x86_64-linuxmusl/sqltex b/Master/bin/x86_64-linuxmusl/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/x86_64-linuxmusl/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/bin/x86_64-solaris/sqltex b/Master/bin/x86_64-solaris/sqltex new file mode 120000 index 00000000000..99fca9fec19 --- /dev/null +++ b/Master/bin/x86_64-solaris/sqltex @@ -0,0 +1 @@ +../../texmf-dist/scripts/sqltex/sqltex
\ No newline at end of file diff --git a/Master/texmf-dist/doc/support/sqltex/SQLTeX.pdf b/Master/texmf-dist/doc/support/sqltex/SQLTeX.pdf Binary files differnew file mode 100644 index 00000000000..050e48021df --- /dev/null +++ b/Master/texmf-dist/doc/support/sqltex/SQLTeX.pdf diff --git a/Master/texmf-dist/doc/support/sqltex/SQLTeX.tex b/Master/texmf-dist/doc/support/sqltex/SQLTeX.tex new file mode 100644 index 00000000000..d3fbc8d6673 --- /dev/null +++ b/Master/texmf-dist/doc/support/sqltex/SQLTeX.tex @@ -0,0 +1,1050 @@ +\documentclass{article} +\newcommand{\bs}{\ensuremath{\backslash}} +\newcommand{\vs}{\vspace{3mm}} +\newcommand{\sqltexversion}{3.0} +\newcommand{\sqltexvmsversion}{3\_0} +\usepackage{makeidx} +\usepackage[pdftex + ,pagebackref=true + ,colorlinks=true + ,linkcolor=blue + ,unicode]{hyperref} +\begin{document} +\title{SQL\TeX\ v\sqltexversion} +\date{Sep 20, 2024} +\author{Oscar van Eijk} +\maketitle +\hrulefill +\tableofcontents +\hrulefill + +\section{Introduction} + +SQL\TeX\ is a preprocessor to enable the use of SQL statements in \LaTeX. It is a perl script that reads +an input file containing the SQL commands, and writes a \LaTeX\ file that can be processed with your +\LaTeX\ package. + +The SQL commands will be replaced by their values. It's possible to select a single field for substitution +substitution in your \LaTeX\ document, or to be used as input in another SQL command. + +When an SQL command returns multiple fields and or rows, the values can only be used for substitution +in the document. + +\subsection{Known limitations} + +\begin{itemize} +\item The \LaTeX\ \texttt{\bs includeonly} directive is ignored; all documents included with \texttt{\bs include} will be parsed and written to the output file. +\item Currently, only 9 command- line parameters (1-9), and 10 variables (0-9) can be used in SQL statements. +\item Replace files can hold only 1,000 items. +\end{itemize} + +\section{Installing SQL\TeX} + +Since v3.0, SQL\TeX\ is part of \TeX\ Live and doesn't need further installation. \\ +If you are using a different LaTeX distro, please follow the steps below for your OS. + +Before installing SQL\TeX, you need to have it. The latest version can always be found at +\url{https://github.com/oveas/sqltex}. +The download consists of this do\-cumentation, an installation script for Unix +(\texttt{install}), and the Perl script \texttt{sqltex}, and a replace- file (\texttt{SQLTeX\_r.dat}) for manual installation +on non- unix platforms\footnote{on Unix, this file will be generated by the install script}. + +\subsection{Requirements} + +SQL\TeX\ requires the following software: + +\begin{itemize} +\item Perl v5.10 or higher (\url{http://perl.org/}) +\item Perl-DBI (\url{http://dbi.perl.org/}) +\item The DBI driver for your database\\(see: \url{http://search.cpan.org/search?query=DBD\%3A\%3A\&mode=module}) +\item Getopt::Long (\url{https://metacpan.org/pod/Getopt::Long}) +\item Term::ReadKey (\url{https://metacpan.org/pod/Term::ReadKey}) +\end{itemize} + +\subsection{Installation} + +If you are using a \TeX\ Live distribution, SQL\TeX\ is already available. For all other distros, follow the steps in this section. + +\vs + +First unpack the archive in a location of your choice and continue with one if the subsections below depending on you operating system. + +\subsubsection{Linux} + +Go to the top directory where the archive was unpacked (`\texttt{cd sqltex-\sqltexversion}') and execute the following commands: + +\vs + +\noindent\texttt{\$ ./configure \textit{[options]}\\ +\$ make \\ +\$ \textit{[sudo] }make install} + +\vs + +In the last command, \texttt{sudo} is only required if the install destination (\texttt{PREFIX}, see below) is outside the own user environment. + +\vs + +For \texttt{configure}, the following options are user buy SQL\TeX\ (type \texttt{./configure --help} for a full list): + +\begin{description} +\item[\texttt{--prefix=PREFIX}] install architecture-independent files in PREFIX. Default is \texttt{/usr/local}. +\item[\texttt{--exec-prefix=EPREFIX}] install architecture-dependent files in EPREFIX. Default is \texttt{PREFIX}. +\end{description} + +The directives above are used by the ones below: + +\begin{description} +\item[\texttt{--bindir=DIR}] Location of the SQL\TeX\ script. Default is \texttt{EPREFIX/bin} +\item[\texttt{--sysconfdir=DIR}] Location of the Configuration- and replacefiles. Default is \texttt{PREFIX/etc} +\item[\texttt{--datarootdir=DIR}] Data root, used by the directives below. Default is \texttt{PREFIX/share} +\item[\texttt{--mandir=DIR}] Location of the SQL\TeX\ manpage. Default is \texttt{DATAROOTDIR/man} +\item[\texttt{--docdir=DIR}] Documentation root, used by \texttt{pdfdir} below. Default is \texttt{DATAROOTDIR/doc/sqltex} +\item[\texttt{--pdfdir=DIR}] Location of SQL\TeX.pdf. Default is \texttt{DOCDIR} +\end{description} + +\vs + +After installation, the archive and unpack- directory can be removed. + +\subsubsection{Windows} + +\noindent\hspace{-3mm}\textit{\underline{Note:}}Since v3.0, the binary \texttt{SQLTEX.EXE} for Windows is not included in the distribution anymore\footnote{ It can be generated with any (portable) perl version for Windows, like Strawberry Perl (\url{https://strawberryperl.com/}\label{winexe}), with \texttt{PAR::Packer} (\url{https://metacpan.org/pod/PAR::Packer}) using the command:\\ +\texttt{pp -o sqltex.exe sqltex}} + +\vs + +The files \texttt{sqltex-\sqltexversion\ensuremath{\backslash}sqltex}, \texttt{sqltex-\sqltexversion\ensuremath{\backslash}src\ensuremath{\backslash}SQLTeX.cfg} and \\ \texttt{sqltex-\sqltexversion\ensuremath{\backslash}src\ensuremath{\backslash}SQLTeX\_r.dat} must be placed manually in the directory of your choice, all in the same direcrtory. + + +\subsubsection{OpenVMS} + +On \textsc{OpenVMS} the files must be copied manually to the destination. All files must reside in the same location:\\ +\texttt{\$ COPY [.SQLTEX-\sqltexvmsversion.SRC]SQLTEX. SYS\$SYSTEM:SQLTEX.PL\\ +\$ COPY [.SQLTEX-\sqltexvmsversion.SRC]SQLTEX.CFG SYS\$SYSTEM:\\ +\$ COPY [.SQLTEX-\sqltexvmsversion.SRC]SQLTEX\_R.DAT SYS\$SYSTEM:\\ +\$ SET FILE/PROTECTION=(W:RE) SYS\$SYSTEM:SQLTEX.PL} + +\vs + +Next, define the command \texttt{SQLTEX} by setting a symbol, +either in the \texttt{LOGIN.COM} for all users who need to execute this script, or in some group-- or +system wide login procedure, with the command: \\ +\texttt{\$ SQLTEX :== "PERL SYS\$SYSTEM:SQLTEX.PL"} + +\subsection{Configuration}\label{config} + +The configuration file \texttt{SQLTeX.cfg} is located in \texttt{/usr/local/etc} (linux) or the same location where SQL\TeX\ is installed (all other operating systems and in \TeX\ Live distros)\footnote{ If a 1.x version of SQL\TeX\ is installed on your system, make sure you save the configuration section, which was inline in older versions}. +Multiple configuration files can be created, the command line option \texttt{--configfile} can be used to +select the requested configuration. + +\vs + +\noindent\hspace{-3mm}\textit{\underline{Note:}}\label{cfg:disable} Use of the \texttt{--configfile} commandfile option can be disabled on system wide installations. To do so, the script \texttt{sqltex} must be modified.\\ +At the top of the file (line 4), set the value for \texttt{\$main::ext\_cfgfile\_allowed} to \texttt{0}. + +\vs + +Some values can be overwritten using command line options (see section~\ref{cmdline}). When the command line options are omitted, the values from the requested configuration file will be used. + +\begin{description} + +\item[dbdriver] Database driver. The default is \texttt{mysql}. +Other supported databases are \texttt{Pg}, \texttt{Sybase}, \texttt{Oracle}\footnote{ This requires the configuration setting \texttt{oracle\_sid}}, \texttt{Ingres}, \texttt{mSQL}, \texttt{PostgreSQL} and \texttt{ODBC}\footnote{ The actual driver can specified with the configuration setting \texttt{odbc\_driver}}, but also others might work without modification. \\ + +\vs + +If your database driver is not support, look for the function +\texttt{db\_connect} to add support (and please notify me :) + +\item[oracle\_sid] Oracle Site Identifier, required when the \texttt{Oracle} database driver is selected. + +\item[odbc\_driver] Specification of the ODBC driver. Default is ``\texttt{SQL Server}'' + + +\item[texex] The default file extension for \LaTeX\ file. When SQL\TeX\ is called, the first +parameter should be the name of the input file. If this filename has no extension, +SQL\TeX\ looks for one with the default extension. + +\item[stx] An output file can be given explicitly using the `\texttt{--output}' option. When omitted, +SQL\TeX\ composes an output file name using this string.\\ +E.g, if your input file is called \texttt{db-doc.tex}, SQL\TeX\ will produce an +outputfile with the name \texttt{db-docstx.tex}. + +\item[def\_out\_is\_in] By default, when no output file is specified or an output file without (relative) path is given, the output file will be generated in the current directory.\\ +This behaviour changed in version 2.1. In older version, the location of the output file always was the same as the input file location. To revert to the old behaviour, set \texttt{def\_out\_is\_in} to `\texttt{1}'\footnote{ Note the pre-v2.1 implementation also contained a bug: if the output file name contained an absolute or relative path, this path was always taken as relative from the input file location. In the new implementation, \texttt{def\_out\_is\_in} is ignored if the output file name contains a path.}. + +\item[multi\_rfile]If the commandline option \texttt{--replacementfile} is given, by default the given replacement file will be parsed and after that the default replacement file will be parsed as well.\\ +If only the given replacement file should be parsed skipping the default file, set this value to \texttt{0}. + +\item[rfile\_comment] The comment-sign used in replace files. If this is empty, comments are not allowed in +the replace files. + +\item[rfile\_regexploc] This must be part of the value \texttt{rfile\_regexp} below. + +\item[rfile\_regexp] Explains how a regular expression is identified in the replace files (see section~\ref{regexp}). + +\item[cmd\_prefix]\label{prefix} SQL\TeX\ looks for SQL commands in the input file. Commands are specified in the +same way all \LaTeX\ commands are specified: a backslash (\bs) followed by the +name of the command.\\ +All SQL\TeX\ commands start with the same string. By default, this is the string +\texttt{\textbf{sql}}. When user commands are defined that start with the same +string, this can be changed here to prevent conflicts. + +\item[sql\_open] This string is appended to the \texttt{cmd\_prefix} to +get the complete SQL\TeX\ command for opening a database.\\ +With the default configuration this command is ``\texttt{\bs sqldb}''. + +\item[sql\_field] This string is appended to the \texttt{cmd\_prefix} to +get the complete SQL\TeX\ command to read a single field from the database.\\ +With the default configuration this command is ``\texttt{\bs sqlfield}''. + +\item[sql\_row] This string is appended to the \texttt{cmd\_prefix} to +get the complete SQL\TeX\ command to read one or more rows from the database.\\ +With the default configuration this command is ``\texttt{\bs sqlrow}''. + +\item[sql\_params] This string is appended to the \texttt{cmd\_prefix} to get the complete SQL\TeX\ command to retrieve a list if fields that will be used as parameters (\texttt{\$PAR1}, see section~\ref{params}) in the multidocument environment (see section~\ref{multidoc}).\\ +With the default configuration this command is ``\texttt{\bs sqlparams}''. + +\item[sql\_update] This string is appended to the \texttt{cmd\_prefix} +to get the complete SQL\TeX\ command to update one or more rows in the database.\\ +With the default configuration this command is ``\texttt{\bs sqlupdate}''. + +\item[sql\_start] This string is appended to the \texttt{cmd\_prefix} to get the complete SQL\TeX\ command start a section that will be repeated for every row from an array (see section~\ref{loops}).\\ +With the default configuration this command is ``\texttt{\bs sqlstart}''. + +\item[sql\_use] This string is appended to the \texttt{cmd\_prefix} to get the complete SQL\TeX\ command use a named variable from the array that is currently being processed in a loop context (see section~\ref{loops}).\\ +With the default configuration this command is ``\texttt{\bs sqluse}''. + +\item[sql\_end] This string is appended to the \texttt{cmd\_prefix} to get the complete SQL\TeX\ command to end a loop context (see section~\ref{loops}).\\ +With the default configuration this command is ``\texttt{\bs sqlend}''. + +\item[sqlsystem\_allowed] Set this to ``1'' to allow the use of the \texttt{\bs sqlsystem} command (see section~\ref{sqlsystem}). + +\item[repl\_step] Replacing strings (see section~\ref{replfiles} below) is done two steps, to prevent values from being replaced twice. +This setting---followed by a three-digit integer - ``000'' to ``999''---is used in the first step and replaces values from the first column. +In the second step, values from the second column replace the temporary value. \\ +If the first column in the replace file contains a character sequence that occurs in this temporary value, or if query results might contain the full string followed by three digits, this value might need to be changed in something unique. + +\item[alt\_cmd\_prefix] In loop context, this setting is used internally to differentiate between sql statements to process immediately and sql statements on stack.\\ +Normally, this setting should never change, but if the value for \texttt{cmd\_prefix} has been changed and a conflict is found, the message ``\texttt{Configuration item 'alt\_cmd\_prefix' cannot start with \textit{<conflicting value>}}'' indicates this setting should change as well. + +\end{description} + +\subsection{Create replace files}\label{replfiles} + +Replace files can be used to substitute values in the output of your SQL commands with a different value. This is especially useful when the database +contains characters that are special characters in \LaTeX, like the percent sign (`\%'), underscore (`\_') etc. + +When SQL\TeX\ is installed, it comes with a standard file---\texttt{SQLTeX\_r.dat}---which is located in \texttt{/usr/local/etc}\footnote{ if a replace file with that name already exists, it will be stored there as \texttt{SQLTeX\_r.dat.new}} (linux) or the same location where SQL\TeX\ is installed (all other operating systems and in \TeX\ Live distros). + +\vspace{3mm} + +\noindent Example: +\begin{verbatim} +$ \$ +_ \_ +% \% +& \& +< \texttt{<} +> \texttt{>} +{ \{ +} \} +# \# +~ \~{} +\ \ensuremath{\backslash} +\end{verbatim} + +\vspace{3mm} + +These are all single character replacements, but you can add your own replacements that consist of a single character or a character sequence (or even regular expressions, see section~\ref{regexp}). + +\vs + +To do so, enter a new line with the character(string) that should be replaced, followed by one or more \texttt{TAB}-character(s) (\textit{not} blanks!) and the character(string) it should be replaced with.\\ +That last one can be empty if the input character(string) should be ignored, but the \texttt{TAB} after the input character(string) is mandatory! + +\vs + +If the first non-blank character is a semicolon (`;'), the line is considered a comment line\footnote{ in the default configuration. See the description for \texttt{rfile\_comment} in section~\ref{config} to change of disable comment lines.}. Blank lines are ignored. + +\vspace{3mm} + +The contents of the file are case sensitive, so of you add the line: \\ +\verb+LaTeX \LaTeX\+ \\ +the word ``LaTeX'' will be changed, but ``latex'' is untouched. + +\vspace{3mm} + +Different replace files can be created. To select a different replace file for a certain SQL\TeX\ source, use the commandline option +`\texttt{--replacementfile \textit{filename}}'. To disable the use of replace files, use `\texttt{no-replacementfile}'. + +\subsubsection{Regular expressions}\label{regexp} + +The replace file can include regular expressions, which are recognized by a pattern given in the configuration setting \texttt{rfile\_regexp}. A part of the pattern, configurable as \texttt{rfile\_regexploc}, will be the actual regular expression. + +\vs + +By default, \texttt{rfile\_regexploc} is ``\texttt{...}'' and \texttt{rfile\_regexp} is ``\texttt{re(...)}''. If the sequence of three dots can appear anywhere else in the replace file, \texttt{rfile\_regexploc} can be changed to any other sequence of characters, e.g. ``\texttt{regexpHere}''.\\ +This also requires \texttt{rfile\_regexp} to be changed. Its new value has to be ``\texttt{re(regexpHere)}'' + +\vs + +Both in the default configuration and with the modification example given above, the key for regular expressions is \texttt{re(<\textit{regular expression}>)}, e.g.:\\ +\hspace{3mm}\verb+re(<p.*?>) \paragraph*{}+ \\ +will replace all HTML \texttt{<}p\texttt{>} variants (\texttt{<}p style='font-size: normal'\texttt{>}, \texttt{<}p align='center'\texttt{>} etc) + +\vs + +An example replacement file using regular expressions to handle HTML codes could look like this: + +\noindent\begin{verbatim} +& \& +<strong> \textbf{ +</strong> } +<em> \textit{ +</em> } +re(<br.*?/?>) \\ +re(<p.*?>) \paragraph*{} +</p> \\[0pt] +<sup> $^{ +</sup> }$ +re(<span.*?>) \textsl{ +</span> } +re(<h1.*?>) \section{ +re(<h2.*?>) \subsection{ +re(<h3.*?>) \subsubsection{ +re(</h\d>) } +\end{verbatim} + +\section{Write your SQL\TeX\ file} + +For SQL\TeX, you write your \LaTeX\ document just as you're used to. SQL\TeX\ provides you with +some extra commands that you can include in your file.\\ +The basic format\footnote{in this document, in all examples will be assumed the default values in the +configuration section as described in section~\ref{config}, have not been changed} of an SQL\TeX\ command is: \\ +\texttt{\bs sql\emph{cmd}[options]\{SQL statement\}} + +\vs + +All SQL\TeX\ commands can be specified anywhere in a line, and can span multiple lines. +When SQL\TeX\ executes, the commands are read, executed, and their results---if they return +any---are written to the output: + +\vs + +\begin{minipage}[t]{0.5\textwidth}\textsl{Input file:}\\\texttt{\footnotesize{\bs documentclass[article] \\ +\bs pagestyle\{empty\} \\ +\bs sqldb[oscar]\{mydb\} \\ +\bs begin\{document\} \\ +}}\end{minipage}\hfill\begin{minipage}[t]{0.5\textwidth}\textsl{Output file:}\\\texttt{\footnotesize{\bs documentclass[article] \\ +\bs pagestyle\{empty\} \\ + \\ +\bs begin\{document\} \\ +}}\end{minipage} + +\vs + +Above you see the SQL\TeX\ command \texttt{\bs sqldb} was removed. Only the command was removed, not +the \textsl{newline} character at the end of the line, so an empty line will be printed instead. +The example below shows the output if an SQL\TeX\ command was found on a line with other \LaTeX\ +directives: + +\vs + +\begin{minipage}[t]{0.5\textwidth}\textsl{Input file:}\\\texttt{\footnotesize{\bs documentclass[article] \\ +\bs pagestyle\{empty\}\bs sqldb[oscar]\{mydb\} \\ +\bs begin\{document\} \\ +\hrulefill}}\end{minipage}\hfill\begin{minipage}[t]{0.5\textwidth}\textsl{Output file:}\\\texttt{\footnotesize{\bs documentclass[article] \\ +\bs pagestyle\{empty\} \\ +\bs begin\{document\} \\ +}}\end{minipage} + +\vs + +In these examples the SQL\TeX\ commands did not return a value. When commands actually read from +the database, the returned value is written instead: + +\vs + +\begin{minipage}[t]{0.5\textwidth}\textsl{Input file:}\\\texttt{\footnotesize{This invoice has \bs sqlfield\{SELECT COUNT(*) FROM INVOICE\_LINE \\ +WHERE INVOICE\_NR = 20190062\} lines.\\ +\hrulefill}}\end{minipage}\hfill\begin{minipage}[t]{0.5\textwidth}\textsl{Output file:}\\\texttt{\footnotesize{This invoice has 3 lines \\ +}}\end{minipage} + +\subsection{SQL statements}\label{sqlstatements} + +This document assumes the reader is familiar with SQL commands. This section only tells something about +implementing them in SQL\TeX\ files, especially with the use of command parameters and variables. +Details about the SQL\TeX\ commands will be described in the next sections. + +\vs + +Let's look at a simple example. Suppose we want to retrieve all header information from the database +for a specific invoice. The SQL statement could look something like this: \\ +\texttt{SELECT $\ast$ FROM INVOICE WHERE NR = 20190062;}\\ +To implement this statement in an SQL\TeX\ file, the \texttt{\bs sqlrow} command should be used (see +section~\ref{sqlrow}): + +First, it is important to know that SQL statements should \textit{not} contain the ending semicolon (;) in +any of the SQL\TeX\ commands. The command in SQL\TeX\ would be:\\ +\texttt{\bs sqlrow\{SELECT $\ast$ FROM INVOICE WHERE NR = 20190062\}} + +Next, SQL\TeX\ would be useless if you have to change your input file every time you want to generate +the same document for another invoice. + +\vs + +Therefore, you parameters or variables can be used in your SQL statement. Parameters are given at the command +line (see section~\ref{params}), variables can be defined using the \texttt{\bs sqlfield} command as +described in section~\ref{vars}. + +Given the example above, the invoice number can be passed as a parameter by rewriting the command as: \\ +\texttt{\bs sqlrow\{SELECT $\ast$ FROM INVOICE WHERE NR = \$PAR1\}} \\ +or as a variable with the code line: \\ +\texttt{\bs sqlrow\{SELECT $\ast$ FROM INVOICE WHERE NR = \$VAR0\}} + +Note you have to know what datatype is expected by your database. In the example here the datatype is +\textsc{integer}. If the field ``\textsc{invoice\_nr}'' contains a \textsc{varchar} type, the +\texttt{\$PAR}ameter or \texttt{\$VAR}iable should be enclosed by quotes: \\ +\texttt{\bs sqlrow\{SELECT $\ast$ FROM INVOICE WHERE NR = '\$PAR1'\}} + +\subsection{Opening the database}\label{opendb} + +Before any information can be read from a database, this database should be opened. +This is done with the \texttt{\textbf{\bs sqldb}} command. +\texttt{\bs sqldb} requires the name of the dabatase. Optionally, a username, password and remote database host can be given. \\ +The format of the command is:\\ +\texttt{\bs sqldb[user=\textit{username},passwd=\textit{password},host=\textit{host}]\{database\}} + +The command can be used anywhere in your input file, but should occur before the first command that tries to +read data from the database. + +\vs + +If the keywords \texttt{user}, \texttt{passwd} and \texttt{host} are omitted, SQL\TeX\ assumes the options are given in +this order:\\ +\texttt{\bs sqldb[\textit{username},\textit{password},\textit{host}]\{database\}} + +Default host is localhost, the default user is the current user. + +\vs + +\noindent\hspace{-3mm}\textit{\underline{Note:}} The \texttt{\bs sqldb} command cannot span multiple lines! + +\subsubsection{Prompt for password and/or username} + +If a password is omitted, SQL\TeX\ will try connect to the database without a password, unless the commandline option \texttt{--password} is given (see section \ref{cmdline}). + +\vs + +Forcing a user to enter a database password when SQL\TeX\ runs can be achieved by specifying \texttt{?} as password:\\ +\texttt{\bs sqldb[user=dbUser,passwd=?]\{database\}} + +\vs + +When different database users should be able to use the same SQL\TeX\ file, the username can also be a question mark, forcing SQL\TeX +to prompt for a username:\\ +\texttt{\bs sqldb[user=?,passwd=?]\{database\}} + +\subsection{Reading a single field}\label{sqlfield} + +When a single field of information is to be read from the database, the command \texttt{\textbf{\bs sqlfield}} +is used. By default, the command in the input file is replaced by its result in the output file.\\ +The SQL command is enclosed by curly braces. Square brackets can optionally be used to enter some extra options. +Currently, the only supported option is \texttt{setvar} (see section~\ref{vars}). + +The full syntax or the \texttt{\bs sqlfield} command is:\\ +\texttt{\bs sqlfield[\textit{options}]\{SELECT \textit{fieldname} FROM \textit{tablename} WHERE \textit{your where-clause}\}} \\ +By default, the SQL\TeX\ command is replaced with the value returned by the SQL query. This behaviour +can be changed with options. + + +\subsubsection{Define variables}\label{vars} + +The \texttt{\bs sqlfield} can also be used to set a variable. The value returned by the SQL query is not +displayed in this case. Instead, a variable is created which can be used in any other SQL query later in +the document (see also section~\ref{sqlstatements}). + +Therefore, the option \texttt{\textbf{[setvar=\textit{n}]}} is used, where \textit{n} is an integer between +0 and 9. + +\vs + +Suppose you have an invoice in \LaTeX. SQL\TeX\ is executed to retrieve the invoice header information +from the database for a specific customer. Next, the invoice lines are read from the database. + +You could pass the invoice number as a parameter to SQL\TeX\ for use in your queries, but that could +change every month. It is easier to :\\ +\begin{itemize} +\item pass the customer number as a parameter, +\item retrieve the current date (assuming that is the invoice date as stored in +the database by another program), and store it in a variable: \\ +\texttt{\bs sqlfield[setvar=0]\{SELECT DATE\_FORMAT(NOW(), "\%Y-\%m-\%d")\}} \\ +This creates a variable that can be used as \texttt{\$VAR0}, +\item retrieve the invoice number using the customer number (a command line parameter, +see also section~\ref{params}) and the variable containing the invoice date. +Store this invoice number in \texttt{\$VAR1}: \\ +\texttt{\bs sqlfield[setvar=1]\{SELECT NR FROM INVOICES \\ +WHERE CUST\_NR = '\$PAR1' AND INVOICE\_DATE = '\$VAR0'\}} +\item use \texttt{\$VAR1} to retrieve all invoice information. +\end{itemize} + +\vs + +The SQL queries used here do not display any output in your \LaTeX\ document. + + +\subsection{Reading rows of data}\label{sqlrow} + +When an SQL query returns more information than one single field, the SQL\TeX\ +command \texttt{\textbf{\bs sqlrow}} should be used. As with the \texttt{\bs sqlfield}, +command, SQL\TeX\ replaces the command with the values it returns, but \texttt{\bs sqlrow} +accepts different options for formatting the output. + +\vs + +By default, fields are separated by a comma and a blank (`\texttt{,~}'), and rows by +a newline character (`\texttt{\bs\bs}'). To change this, the options ``\texttt{fldsep}'' +and ``\texttt{rowsep}'' can be used. + +e.g. In a \texttt{tabular} environment the fields should be separated by an ampersand (\texttt{\&}), +perhaps a line should separate the rows of information. (\texttt{\bs\bs~\bs hline}). +To do this, the options can be used with \texttt{\bs sqlrow} as shown here: \\ +\texttt{\bs sqlrow[fldsep=\&,rowsep=\bs\bs~\bs hline]\{SELECT I.NR, A.NR, +A.PRICE, I.AMOUNT, (A.PRICE * I.AMOUNT) FROM ARTICLE A, INVOICE\_LINE I WHERE I.NR = \$VAR1 +AND I.ARTICLE\_NR = A.NR\}} + +\vs + +This will produce an output like: \\ +\texttt{1 \& 9712 \& 12 \& 1 \& 12 \bs\bs~\bs hline +2 \& 4768 \& 9.75 \& 3 \& 29.25 \bs\bs~\bs hline +3 \& 4363 \& 1.95 \& 10 \& 19.5 \bs\bs~\bs hline +4 \& 8375 \& 12.5 \& 2 \& 25 \bs\bs~\bs hline} + +\subsubsection{Output rows on separate lines} + +Some \LaTeX\ packages require input on a separate line. If this output is to be +read from a database, this can be set with the \texttt{rowsep} option using the +fixed text ``\texttt{NEWLINE}''. + +Changing the example from section \ref{sqlrow} above to:\\ +\texttt{\bs sqlrow[fldsep=\&,rowsep=\bs\bs~\bs hline NEWLINE]\{SELECT I.NR, A.NR, +A.PRICE, I.AMOUNT, (A.PRICE * I.AMOUNT) FROM ARTICLE A, INVOICE\_LINE I WHERE I.NR = \$VAR1 +AND I.ARTICLE\_NR = A.NR\}} + +\vs + +would produce the following result: \\ +\texttt{1 \& 9712 \& 12 \& 1 \& 12 \bs\bs~\bs hline \\ +2 \& 4768 \& 9.75 \& 3 \& 29.25 \bs\bs~\bs hline \\ +3 \& 4363 \& 1.95 \& 10 \& 19.5 \bs\bs~\bs hline \\ +4 \& 8375 \& 12.5 \& 2 \& 25 \bs\bs~\bs hline} + + + +\subsubsection{Store data in an array} + + +The \texttt{\bs sqlrow} command can also be used to store the data in an array. The value returned by the SQL query is not displayed in this case. Instead, an array is created which can be used later in the document in a loop context (see section~\ref{loops}). + +Therefore, the option \texttt{\textbf{[setarr=\textit{n}]}} is used, where \textit{n} is an integer between +0 and 9. + +\subsection{Loop context}\label{loops} + +In a loop context, an array is filled with data from the database using \texttt{\bs sqlrow}.\\ +Later in the document, the data can be used in a text block that will be written to the output file once for every record retrieved. + +\vs + +The text block is between the \texttt{\bs sqlstart\{\textit{n}\}} and \texttt{\bs sqlend\{\textit{n}\}} commands, where \textit{n} is the sequence number of the array to use\footnote{ in \texttt{\bs sqlend}, the sequence number is ignored, but required by syntax.}. + +Multiple text blocks can occur in the document, but they can \textit{not} be nested! + +\vs + +In the example below, data for unpaid invoices is stored in an array identified with sequence number 0: + +\texttt{\bs sqlrow[setarr=0]\{SELECT I.NR AS nr\\ +\hspace*{15mm}, I.DUE\_DATE AS date\\ +\hspace*{15mm}, I.TOTAL AS amount\\ +\hspace*{15mm}, C.NAME AS customer\\ +\hspace*{15mm}FROM INVOICE I\\ +\hspace*{15mm}LEFT OUTER JOIN CUSTOMER C\\ +\hspace*{20mm}ON C.NR = I.CUST\_NR\\ +\hspace*{15mm}WHERE I.PAY\_DATE IS NULL\}} + +\vs + +To use this data, a text block must start with: \texttt{\bs sqlstart\{0\}}\\ +Between this command and the first occurrence of \texttt{\bs sqlend\{\}}, an unlimited amount\footnote{ limited by your computer's memory only} of \LaTeX\ text can be written. Within this text, every occurrence of \texttt{\bs sqluse\{<\textit{field name}>\}} will be replaced with the matching field from the current row, e.g.: + +\noindent\begin{verbatim} +\sqlstart{0} +\begin{flushright} +Regarding: invoicenumber \sqluse{nr} +\end{flushright} + +Dear \sqluse{customer}, + +On \today, the invoice with number \sqluse{nr}, payable before +\sqluse{date}, was not yet received by us. + +We kindly request you to pay the amount of \texteuro\sqluse{amount} +as soon as possible. + +\newpage +\sqlend{} +\end{verbatim} + +\subsubsection{If-endif control block} + +In the loop context, parts of the document can be enabled if certain conditions are met, using a control block with \texttt{\bs sqlif\{\textit{condition(s)}\}} and \texttt{\bs sqlendif\{\}}. + +\vs + +\textit{Conditions} can be up to 2 conditions separated by an \textit{and} (\texttt{\&\&}) or \textit{or} (\texttt{||}). + +The condition(s) consist of an left value and an right value seperated by 1 of the following comparisson operators: `\texttt{==}', `\texttt{!=}', `\texttt{<}',. `\texttt{>}', `\texttt{<=}' or `\texttt{>=}'.\\ +Numeric values will be used as is. When the value is text, it is expected to be the name of a field and `\texttt{\bs sqluse\{\}}` will be called to retrieve the value. +\vs + +\noindent Example:\\ +\texttt{\bs sqlif\{article\_nr == 123 \&\& \bs stock < 5\}\\ +Stock is below threshold, please reorder. +}\\ +\bs sqlendif\{\} + +\vs + +Note the conditions are very basic with the following limitations: +\begin{itemize} +\item A maximum of 2 conditions is supported per if-statement. +\item Only numeric comparissons are supported. +\item If-elsif blocks cannot be nested. +\end{itemize} + +When checks are needed that are not supported by SQL\TeX, a workaround can be implemented in the SQL code. + + +\subsection{Get input from external programs}\label{sqlsystem} + +The \texttt{\bs sqlsystem} command can be used to call commands at the operating system or external scripts and use their output in the location where the command was given. Any command arguments can be given in the command line. + +When used in a loop context (see section~\ref{loops}), \texttt{\bs sqluse} can also be used to provide data to the script. If command arguments must be given for database access, the following tags can be used: + +\begin{itemize} +\item[\texttt{<SRV>}] Name of the database server. +\item[\texttt{<USR>}] Username to connect to the database. +\item[\texttt{<PWD>}] Password to connect to the database. +\item[\texttt{<DB>}] Name of the database. +\end{itemize} + +They will be replaced by the credentials for connecting to the database (see section~\ref{opendb}). + + +\vs + +\noindent Example:\\ +\texttt{\bs sqlsystem\{./add\_vat --usr <USR> --db <DB> --pwd <PWD> $\hookleftarrow$ \\ +--inv \bs sqluse\{invoice\_nr\}\}} + +\vs + +By default, use of this command is disallowed. To enable it, set the value of \texttt{sqlsystem\_allowed} to ``1'' in the configuration file (see also section~\ref{config}. + +If the command is disabled, occurances of this command will be replaced by the fixed text ``\texttt{use of the \bs sqlsystem command is disallowed in the configuration}''. + +\vs + +\noindent\hspace{-3mm}\textit{\underline{Note:}} The \texttt{\bs sqlsystem} command cannot span multiple lines! + + +\subsection{Output multiple documents}\label{multidoc} + +A single input file can be created to generate more output files using the \texttt{--multidoc-numbered} or \texttt{--multidoc-named} commandline option. + +The input document must contain the command \texttt{\bs sqlsetparams} without any options. The query that follows can return an unlimited number of rows: \\ +\texttt{\bs sqlsetparams\{SELECT NR, CUST\_NR FROM INVOICES WHERE REMINDERS = \$PAR1\}} + +\vs + +By processing this command, SQL\TeX\ builds a list with all values retrieved and +processes the input file again for each row.\\ +In those runs, the queries are executed as described in the previous sections, +using the returned fields to replace \texttt{\$MPAR\textit{n}} placeholders, where \textit{n} starts with 1 and represents the fields in the order as they have been retrieved:\\ +\texttt{\bs sqlrow\{SELECT * FROM INVOICES WHERE NR = \$MPAR1\}} \\ +\texttt{\bs sqlrow\{SELECT * FROM CUSTOMER WHERE CUST\_NR = \$MPAR2\}} + +\vs + +The options \texttt{--multidoc-numbered} or \texttt{--multidoc-named} cannot be used together.\\ +Without these options, a parameter can be given and a single output +document will be created, ignoring the \texttt{\bs sqlsetparams} command. + +\vs + +With the \texttt{--multidoc-numbered} option, output filenames will be numbered \texttt{\emph{filename}\_1.tex} to \texttt{\emph{filename}\_\emph{n}.tex}.\\ +With the \texttt{--multidoc-named} option, output filenames will be numbered \\\texttt{\emph{filename}\_\emph{parameter}.tex}, where \emph{parameter} is the first value taken from the database (\texttt{\$MPAR1}, the invoice number \texttt{nr} in the example above). \\ +Note the parameter will not be formatted to be filename-friendly!\\ + + +\subsection{Update database records} + +Since version 1.5, SQL\TeX\ supports database updates as well: \\ +\texttt{\bs sqlupdate\{UPDATE INVOICE SET REMINDERS = REMINDERS + 1, +LAST\_REMINDER = NOW() WHERE NR = \$VAR1\}} + +This command accepts no options. + +\vs + +By default, the update statements will be ignored. To actually process them, the commandline options \texttt{--updates} must be given! + +\section{Process your SQL\TeX\ file} + +To process your SQL\TeX\ file and create a \LaTeX\ file with all information read from +the database, call SQL\TeX\ with the parameter(s) and (optional) command\-line options as +described here. + +\subsection{Parameters}\label{params} + +SQL\TeX\ accepts more than one parameter. The first parameter is required; this should +be the input file, pointing to your \LaTeX\ document containing the SQL\TeX\ commands. + +By default, SQL\TeX\ looks for a file with extension `\texttt{.tex}'. + +\vs + +All other parameters are used by the queries, if required. If an SQL query contains the +string \texttt{\$PAR\textit{n}}\footnote{where \textit{n} is a number between 1 and 9. Note +parameter `0' cannot be used, since that contains the filename!}, it is replaced by that parameter +(see also section~\ref{sqlstatements}). + +\subsection{Command line options}\label{cmdline} + +SQL\TeX\ accepts the following command- line options: + +\begin{description} +\item[\texttt{--configfile \textit{file}, -c \textit{file}}] SQL\TeX\ configuration file. Default is \texttt{SQLTeX.cfg} in the systems default location (see section \ref{config}). + +\item[\texttt{--file-extension \textit{string}, -E \textit{string}}] replace input file extension in outputfile: +\texttt{input.tex} will be \texttt{input.\textit{string}}. \\ +For further notes, see option \texttt{--filename-extend} below. + +\item[\texttt{--filename-extend \textit{string}, -e \textit{string}}] add \textit{string} to the output filename: +\texttt{input.tex} will be \texttt{input\textit{string}.tex}. This overwrites +the configuration setting \texttt{stx}. \\ +In \textit{string}, the values between curly braces \{\} will be substituted: +\begin{description} +\item[P\textit{n}] parameter \textit{n} +\item[M] current monthname (\textit{Mon}) +\item[W] current weekday (\textit{Wdy}) +\item[D] current date (\textit{yyyymmdd}) +\item[DT] current date and time (\textit{yyyymmddhhmmss}) +\item[T] current time (\textit{hhmmss}) +\end{description} +e.g., the command\\ +\hspace*{1em}\texttt{sqltex --filename-extend \_\{P1\}\_\{W\} my\_file code}\\ +will read `\texttt{my\_file.tex}' and write `\texttt{myfile\_code\_Tue.tex}'.\\ +The same command, but with option \texttt{---file-extension} would create the outputfile \texttt{my\_file.\_code\_Tue}\\ +The options \texttt{--file-extension} and \texttt{--filename-extend} cannot be used together or with \texttt{--output}. + +\item[\texttt{--force, -f}] force overwrite of existing files. By default, SQL\TeX\ exits with a +warning message it the outputfile already exists. + +\item[\texttt{--help, -h}] print this help message and exit. + +\item[\texttt{--multidoc-numbered, -m}] Multidocument mode; create one document for each parameter that is retrieved +from the database in the input document (see section~\ref{multidoc}). This option cannot be used with \texttt{--output}. + +\item[\texttt{--multidoc-named, -M}] Same as \texttt{--multidoc-numbered}, but with the parameter in the filename instead of a serial number (see section~\ref{multidoc}). + +\item[\texttt{--null-allowed, -N}] \texttt{NULL} return values allowed. By default SQL\TeX\ exits if a +query returns an empty set. + +\item[\texttt{--output \textit{file}, -o \textit{file}}] specify an output file. Cannot be used with \texttt{--file-extension}, +\texttt{--filename-extend} or the \texttt{--multidoc} options. + +\item[\texttt{--skip-empty-lines, -S}] All SQL\TeX\ commands will be removed from the input line or replaced by the corresponding value. The rest of the input line is written to the output file. +This includes lines that only contain a SQL\TeX\ command (and a newline character). This will result in an empty line in the output file.\\ +By specifying this option, these empty lines will be skipped. Lines that were empty in the input will be written. + +\item[\texttt{--write-comments, -C}] \LaTeX\ comments in the input file will be skipped by default. With this option, comments will also be copied to the output file. + +\item[\texttt{--prefix \textit{prefix}, -p \textit{prefix}}] prefix used in the SQL\TeX\ file. Default is \texttt{sql} (see also section~\ref{config} +on page~\pageref{prefix}. This overwrites the configurarion setting \texttt{cmd\_prefix}. + +\item[\texttt{--password \textit{[password]}, -P} \textit{[password]}] database password. The value is optional; if omitted, SQL\TeX\ will prompt for a password. This overwrites the password in the input file. + +\item[\texttt{--quiet, -q}] run in quiet mode. + +\item[\texttt{--replacementfile \textit{replace}, -r \textit{replace}}] Specify a file that contains the replace characters (see section~\ref{replfiles}). \\ +Default is \texttt{SQLTeX{\_}r.dat} in the systems default location (see section \ref{replfiles}). This default file will always be used after the given replacement file, unless \texttt{multi\_rfile} is set to \texttt{0} in the configuration (see secion \ref{config}). + +\item[\texttt{--no-replacementfile, -R}] Do not use a replace file. \texttt{--no-replacementfile} and \texttt{--replacementfile \textit{file}} are handled in the same order as +they appear on the command line, overwriting each other.\\ +For backwards compatibility, \texttt{-rn} is also still supported. + +\item[\texttt{--sqlserver \textit{server}, -s \textit{server}}] SQL server to connect to. Default is \texttt{localhost}. + +\item[\texttt{--updates, -u}] if the input file contains updates, process them. + +\item[\texttt{--username \textit{user}, -U \textit{user}}] database username. This overwrites the username in the input file. + +\item[\texttt{--version, -V}] print version number and exit. +\end{description} + + + +\section{SQL\TeX\ errors and warnings} + +\noindent\textbf{\texttt{no input file specified}} + +\vspace{1mm} + +\noindent SQL\TeX\ was called without any parameters.\\ +\textit{Action:} Specify at least one parameter at the commandline. This parameter should be +the name of your input file. + +\vs + +\noindent\textbf{\texttt{File \textit{input filename} does not exist}} + +\vspace{1mm} + +\noindent The input file does not exist.\\ +\textit{Action:} Make sure the first parameter points to the input file. + +\vs + +\noindent\textbf{\texttt{outputfile \textit{output filename} already exists}} + +\vspace{1mm} + +\noindent The outputfile cannot be created because it already exists.\\ +\textit{Action:} Specify another output filename with command line option \texttt{-e}, +\texttt{-E} or \texttt{-o}, or force an overwrite with option \texttt{-f} (see also section\ref{cmdline}). + +\vs + +\noindent\textbf{\texttt{no database opened at line \textit{line nr}}} + +\vspace{1mm} + +\noindent A query starts at line \textit{line nr}, but at that point no database was opened yet. \\ +\textit{Action:} Add an \texttt{\bs sqldb} command prior to the first query statement. + +\vs + +\noindent\textbf{\texttt{insufficient parameters to substitute variable on line \textit{line nr}}} + +\vspace{1mm} + +\noindent The query starting at line \textit{line nr} uses a parameter in a \textsc{where}- clause with +\texttt{\$PAR\textit{n}}, where \textit{n} is a number bigger than the number of parameters +passed to SQL\TeX\. \\ +\textit{Action:} Specify all required parameters at the command line. + +\vs + +\noindent\textbf{\texttt{trying to substitute with non existing on line \textit{line nr}}} + +\vspace{1mm} + +\noindent The query starting at line \textit{line nr} requires a variable \texttt{\$VAR\textit{n}} in its +\textsc{where}- clause, where \textit{n} points to a variable that has not (yet) been set. \\ +\textit{Action:} Change the number or set the variable prior to this statement. + +\vs + +\noindent\textbf{\texttt{trying to overwrite an existing variable on line \textit{line nr}}} + +\vspace{1mm} + +\noindent At line \textit{line nr}, a \texttt{\bs sqlfield} query tries to set a variable \textit{n} +using the option \texttt{[setvar=\textit{n}]}, but \texttt{\$VAR\textit{n}} already +exists at that point. \\ +\textit{Action:} Change the number. + +\vs + +\noindent\textbf{\texttt{no result set found on line \textit{line nr}}} + +\vspace{1mm} + +\noindent The query starting at line \textit{line nr} returned a \texttt{NULL} value. If the +option \texttt{-N} was specified at the commandline, this is just a warning message. +Otherwise, SQL\TeX\ exits. \\ +\textit{Action:} None. + +\vs + +\noindent\textbf{\texttt{result set too big on line \textit{line nr}}} + +\vspace{1mm} + +\noindent The query starting at line \textit{line nr}, called with \texttt{\bs sqlfield} returned more than one field. \\ +\textit{Action:} Change your query or use \texttt{\bs sqlrow} instead. + +\vs + +\noindent\textbf{\texttt{no parameters for multidocument found on line \textit{line nr}}} + +\vspace{1mm} + +\noindent SQL\TeX\ is executed in multidocument mode, but the statement on line +\textit{line nr} did not provide any parameters for the documents. \\ +\textit{Action:} Check your query. + +\vs + +\noindent\textbf{\texttt{too many fields returned in multidocument mode on \textit{line nr}}} + +\vspace{1mm} + +\noindent In multidocument mode, the lis of parameters retrieved on line +\textit{line nr} returned more than one fields per row. \\ +\textit{Action:} Check your query. + +\vs + +\noindent\textbf{\texttt{start using a non-existing array on line \textit{line nr}}} + +\vspace{1mm} + +\noindent An \texttt{\bs sqlstart} command occurs, but refers to a non-existing array. \\ +\textit{Action:} Check the sequence number of the array filled with \texttt{\bs sqlrow[setarr=\textit{n}]} and retrieved with \texttt{\bs sqlstart\{\textit{n}\}} in your input file. + +\vs + +\noindent\textbf{\texttt{\bs sqluse command encountered outside loop context on line \textit{line nr}}} + +\vspace{1mm} + +\noindent Data from array is used, but the current input file position is not in the context where this data is available.\\ +\textit{Action:} Check the presence and positions of the \texttt{\bs sqlstart} and \texttt{\bs sqlend} commands in your input file. + +\vs + +\noindent\textbf{\texttt{unrecognized command on line \textit{line nr}}} + +\vspace{1mm} + +\noindent At line \textit{line nr}, a command was found that starts with ``\texttt{\bs sql}'', +but this command was not recognized by SQL\TeX\. \\ +\textit{Action:} Check for typos. If the command is a user- defined command, it will +conflict with default SQL\TeX\ commands. Change the SQL\TeX\ command prefix (see section~\ref{config}). + +\vs + +\noindent\textbf{\texttt{no sql statements found in \textit{input filename}}} + +\vspace{1mm} + +\noindent SQL\TeX\ did not find any valid SQL\TeX\ commands. \\ +\textit{Action:} Check your input file. + + +\section{Copyright and disclaimer} + +\noindent\hrulefill \\ +The SQL\TeX\ project is available from GitHub: \url{https://github.com/oveas/sqltex}\\ +For bugs, questions and comments, please use the issue tracker available at \url{https://github.com/oveas/sqltex/issues} + +\vspace{3mm} + +\noindent Copyright\copyright\ 2001-2024 - Oscar van Eijk, Oveas Functionality Provider + +\noindent\hrulefill \\ + +\noindent This software is subject to the terms of the LaTeX Project Public License; +see \url{http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html}. + +\section{History} + +\begin{description} +\item[v3.0] \textit{released: Sep 20, 2024} +\begin{itemize} +\item Made it possible to run SQL\TeX\ directly from the distribution without \texttt{configure} and \texttt{make [install]} to make integration in \TeX\ Live possible. +\item Renamed the script to \texttt{sqltex}. For backwards compatibility, during installation on linux a symbolic link \texttt{SQLTeX} is created. +\item The \texttt{SQLTeX.exe} binary is no longer included in the distribution (see footnote \footref{winexe} on page \pageref{winexe}). +\item Removed support for the \texttt{--use-local-config} commandline option. The options \texttt{--configfile} and \texttt{--replacementfile} can be used instead. +\item Added an option to disable the \texttt{--configfile} command line option (see note on page \pageref{cfg:disable}). +\item Added the \texttt{--skip-empty-lines} and \texttt{--write-comments} commandline options. +\item Added support for multiple replacement files. +\item Fix: ordering in the replacement file. +\end{itemize} + +\item[v2.2] \textit{released: Jul 31, 2024} +\begin{itemize} +\item Extended the default replace file (see \ref{replfiles}) with more special characters (e.g. with diacritics) and HTML tags. +\item Issue \#6 (\url{https://github.com/oveas/sqltex/issues/6}): added support for ODBC drivers +\item Issue \#8 (\url{https://github.com/oveas/sqltex/issues/8}): added support for parameter-driven in \texttt{\bs sqlsetparams} statements (multi-document mode).\\ +\textit{\textbf{Note:}} This requires an update of your input files for multi-document mode that have been created before v2.2. Refer to section \ref{mdocupdates} for details. +\item Added the \texttt{\bs sqlsystem} command. +\item Added the \texttt{\bs sqlif}-\texttt{\bs sqlendif} control block. +\end{itemize} + +\item[v2.1] \textit{released: Jan 21, 2022} +\begin{itemize} +\item Fix bug \#2 (\url{https://github.com/oveas/sqltex/issues/2}): standard path management for output files.\\ +See config item \texttt{def\_out\_is\_in} in section \ref{config} to revert to pre v2.1 behaviour. +\item Fix: help was not displayed on Windows +\item Implemented '?' as password in \texttt{dbopen} +\item Implemented '?' as username in \texttt{dbopen} +\item Implemented long options +\item Allow overwriting variables in multidocument mode +\item Added simple automated regression tests +\item Added a man page for linux users +\item Rewrote the installation procedure, now using \texttt{autotools} on linux. +\item On linux, change the default installation directory to \texttt{/usr/bin} and store the configuration- and replacement files is \texttt{/etc}. +\item Added option \texttt{--use-local-config}. +\end{itemize} + +\item[v2.0] \textit{released: Jan 12, 2016} +\begin{itemize} +\item Fix: Oracle support using ORASID +\item Fix: Ensure replacements are handled in the same order as they appear in the replacements file +\item Separate configuration file(s) +\item Added the options \texttt{-c} and \texttt{-M} +\item Support for regular expressions in replace files +\item Implemented support for the \LaTeX\ \texttt{\bs input} and \texttt{\bs include} directives +\item Implemented loop context +\item Skip commentlines +\item Project moved from local CVS to GitHub +\end{itemize} + +\item[v1.5] \textit{released: Nov 23, 2007} +\begin{itemize} +\item Support for multiple databases +\item Implemented database updates (\texttt{sqlupdate}) +\item Implemented multiple output documents (option \texttt{-m}) +\end{itemize} + +\item[v1.4.1] \textit{released: Feb 15, 2005}\\ +Fix: removed leading whitespaces added to database results before replace + +\item[v1.4] \textit{released: May 2, 2002}\\ +Implemented replace files + +\item[v1.3] \textit{released: Mar 16, 2001}\\ +First public release + +\end{description} + +\subsection{Changes that require updates in your input files} + +\subsubsection{Multi-document mode since v2.2}\label{mdocupdates} + +Up until v2.1, the statement in \texttt{\bs sqlsetparams} could return only one field per row and the statement itself could not handle parameters. The placeholder \texttt{\$PAR1} was reserved for the subsequent statements. + +Since v2.2 it is possible to retrieve multiple values per row. They will replace the placeholders \texttt{\$MPAR\textit{n}} in the subsequent statements, while \texttt{\$PAR\textit{n}} placeholders can now also be used for regular parametes in the \texttt{\bs sqlsetparams} statement itself. + +\vs + +This means, in input documents created before v2.2, all ``\texttt{\$PAR1}'' placeholders must be replaced by ``\texttt{\$MPAR1}''. + +\end{document} diff --git a/Master/texmf-dist/scripts/sqltex/SQLTeX.cfg b/Master/texmf-dist/scripts/sqltex/SQLTeX.cfg new file mode 100644 index 00000000000..db6c507c2b1 --- /dev/null +++ b/Master/texmf-dist/scripts/sqltex/SQLTeX.cfg @@ -0,0 +1,84 @@ +# Pg, Sybase, Oracle, Ingres, mSQL, ODBC,... +# +dbdriver = mysql + +# Driver for ODBC, ignored for other databases +# +odbc_driver = SQL Server + +# SID for Oracle users, ignored for other databases +# +oracle_sid = ORASID + +# default tex- file extension +# +texex = tex + +# file name extension to insert before the last '.' +# +stx = _stx + +# When no output file is specified or output file without (relative) path is given, an output file +# is generated in the current directory. +# By setting 'def_out_is_in' to True (1), the output file is generated in the same directory +# where the input file resides (this was the behaviour up until v2.0). +# Refer to the documentation for more info. +# +def_out_is_in = 0 + +# If the commandline option --replacementfile or -r is given, by default the given replacement file +# will be parsed and after that the default replacement file will be parsed as well. +# If only the given replacement file should be parsed skipping the default file, set the value +# below to 0. +# +multi_rfile = 1 + +# Comment-sign used in the replace file(s). Leave empty to disable comments +# +rfile_comment = ; + +# Indicator of a regular expression in the replace file. The rfile_regexploc setting indicates the +# position of the regular expression and must be part of 'rfile_regexp' +# Refer to the documentation for more info. +# +rfile_regexploc = ... +rfile_regexp = re(...) + +# Command section. All SQLTeX commands start with <cmd_prefix> and are followed +# by the actual command. Change this only if latex commands are used that conflict +# with the defaults. +# +cmd_prefix = sql +sql_open = db +sql_field = field +sql_row = row +sql_params = setparams +sql_update = update +sql_start = start +sql_end = end +sql_use = use +sql_system = system +sql_if = if +sql_endif = endif + +# Defines if the \sqlsystem{} command is allowed. +# This is disabled by default, enable only if you are sure no SQLTeX files can be called that +# might harm your system +# +sqlsystem_allowed = 0 + +# If the Term::ReadKey perl module is not installed, it is not possible to enter a password +# and hide it from the console when. In that case SQLTeX will abort if a password is specified +# as '?' in the LaTeX input file. +# To allow entering passwords that are readable from at the console, set the following to 1. +# NOTE: If you need to set this value to 1, you're strongly adviced to install the Term::ReadKey +# module instead: +# sudo cpan install Term::ReadKey +# +allow_readable_pwd = 0 + +# The values below are used internally only. There's no need to change these, +# unless there are conflicts. Refer to the documentation for more info. +# +repl_step = OSTX +alt_cmd_prefix = processedsqlcommand diff --git a/Master/texmf-dist/scripts/sqltex/SQLTeX_r.dat b/Master/texmf-dist/scripts/sqltex/SQLTeX_r.dat new file mode 100644 index 00000000000..309d85b235e --- /dev/null +++ b/Master/texmf-dist/scripts/sqltex/SQLTeX_r.dat @@ -0,0 +1,101 @@ +; This file contains all characters or character sequences that +; will be be replaced by SQLTeX when the occur in the response +; of an SQL query. +; +; The first column is the character (sequence) that will be replaced. +; The second column is the value to replace col 1 with. +; Columns are separated with one or more tab characters. +; +; Note all values are case sensitive; if you add the line: +; LaTeX \LaTeX\ +; the word "latex" will be untouched, but "LaTeX" will be replaced. +; +; To replace using regular expressions, use 're(<regular expression>)' +; as key (or any other regexp indicator if that has been changed in the +; config file), e.g. +; re(<p\.*?>) \paragraph*{} +; will replace all HTML <p> variants (<p style='font-size: normal'>, +; <p align='center'> etc) +; +; Order matters! +; We must start with the HTML code, since if the LaTeX special characters +; would be first, the characters '<' and '>' would be replaced already so +; HTML code is not recognised anymore. +; +; +; HTML special characters +; ----------------------- +; + \hspace{1em} +& \& +& \& +' ' +; +; HTML font types +; --------------- +; +re(<strong.*?>) \textbf{ +</strong> } +re(<em.*?>) \textit{ +</em> } +<del> \sout{ +</del> } +<sup> $^{ +</sup> }$ +; +; HTML links (ignored) +; -------------------- +; +re(<a .*?>) +</a> +; +; HTML sections and breaks +; ------------------------ +; +re(<p.*?>) +</p> \\[0pt] +re(<h1.*?>) \section{ +re(<h2.*?>) \subsection{ +re(<h3.*?>) \subsubsection{ +re(</h\d>) } +re(<br\s*/?>) \\ +; +; HTML lists +; ---------- +; +<ul> \begin{itemize} +<li> \item\ +</li> +</ul> \end{itemize} +; +; HTML tables +; ----------- +; This is meant as an example only and outcommented. +; Replace the tabular with the desired number of columns +; before using this. +; +;re(<table.*?>) \begin{tabular}{lll} +;re(</?tbody>) +;re(<tr.*?>) +;</tr> \\ +;re(<td.*?>) +;</td> & +;</table> \end{tabular} \\ +; +; +; LaTeX special characters +; ------------------------ +; +$ \$ +_ \_ +% \% +& \& +< \texttt{<} +> \texttt{>} +{ \{ +} \} +# \# +~ \~{} +\ \ensuremath{\backslash} +; + diff --git a/Master/texmf-dist/scripts/sqltex/sqltex b/Master/texmf-dist/scripts/sqltex/sqltex new file mode 100755 index 00000000000..ea612c790f2 --- /dev/null +++ b/Master/texmf-dist/scripts/sqltex/sqltex @@ -0,0 +1,1381 @@ +#!/usr/bin/env perl + +# To disable support for the --configfile option, set the value below to 0. +$main::ext_cfgfile_allowed = 1; + +################################################################################ +# +# SQLTeX - SQL preprocessor for Latex +# +# File: sqltex +# ===== +# +# Purpose: This script is a preprocessor for LaTeX. It reads a LaTeX file +# ======== containing SQL commands, and replaces them their values. +# +# This software is subject to the terms of the LaTeX Project Public License; +# see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html. +# +# Copyright: (c) 2001-2024, Oscar van Eijk, Oveas Functionality Provider +# ========== oscar@oveas.com +# This software is subject to the terms of the LaTeX Project Public License; +# see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html +# +# History: +# ======== +# v1.3 Mar 16, 2001 (Initial release) +# v1.4 May 2, 2002 +# v1.4.1 Feb 15, 2005 +# v1.5 Nov 23, 2007 +# v2.0 Jan 12, 2016 +# v2.1 Jan 21, 2022 +# v2.1-1 Apr 19, 2022 (test version for MSSQL, no official release) +# v2.1-2 Jun 25, 2023 (test version parameter in sql_setparams(), no official release) +# v2.1-3 Nov 30, 2023 (test version \sqlif-\sqlendif & \sqlsystem, no official release) +# v2.2 Jul 31, 2024 +# v3.0 Sep 20, 202x +# Refer to the documentation for changes per release +# +# TODO: +# ===== +# Code is getting messy - too many globals: rewrite required +# +################################################################################ +# +#use strict; +use DBI; +use Getopt::Long; +Getopt::Long::Configure ("bundling"); +use Cwd; +use feature 'state'; + +$main::ReadKey_available = eval +{ + require Term::ReadKey; + Term::ReadKey->import(); + 1; +}; + +##### +# Find out if any command-line options have been given +# Parse them using 'Getopt' +# +sub parse_options { + + $main::NULLallowed = 0; + + if (!GetOptions('help|h|?' => \$main::options{'h'} + , 'configfile|c=s' => \$main::options{'c'} + , 'replacementfile|r=s' => \$main::options{'r'} + , 'no-replacementfile|R' => \$main::options{'R'} + , 'output|o=s' => \$main::options{'o'} + , 'skip-empty-lines|-S' => \$main::options{'S'} + , 'write-comments|-C' => \$main::options{'C'} + , 'filename-extend|e=s' => \$main::options{'e'} + , 'file-extension|E=s' => \$main::options{'E'} + , 'sqlserver|s=s' => \$main::options{'s'} + , 'username|U=s' => \$main::options{'U'} + , 'password|P:s' => \$main::options{'P'} + , 'null-allowed|N' => \$main::options{'N'} + , 'version|V' => \$main::options{'V'} + , 'force|f' => \$main::options{'f'} + , 'quiet|q' => \$main::options{'q'} + , 'multidoc-numbered|m' => \$main::options{'m'} + , 'multidoc-named|M' => \$main::options{'M'} + , 'prefix|p=s' => \$main::options{'p'} + , 'use-local-config|l' => \$main::options{'l'} + , 'updates|u' => \$main::options{'u'} + )) { + print "usage: sqltex [options] <file[.$main::configuration{'texex'}]> [parameter...]\n" + . " type \"sqltex --help\" for help\n"; + exit(1); + } + + if (defined $main::options{'h'}) { + &print_help; + exit(0); + } + if (defined $main::options{'V'}) { + &print_version; + exit(0); + } + + my $optcheck = 0; + $optcheck++ if (defined $main::options{'E'}); + $optcheck++ if (defined $main::options{'e'}); + $optcheck++ if (defined $main::options{'o'}); + die ("options \"-E\", \"-e\" and \"-o\" cannot be combined\n") if ($optcheck > 1); + + $optcheck = 0; + $optcheck++ if (defined $main::options{'m'}); + $optcheck++ if (defined $main::options{'M'}); + $optcheck++ if (defined $main::options{'o'}); + die ("options \"-m\", \"-M\" and \"-o\" cannot be combined\n") if ($optcheck > 1); + + $optcheck = 0; + $optcheck++ if (defined $main::options{'r'}); + $optcheck++ if (defined $main::options{'R'}); + die ("options \"-r\" and \"-R\" cannot be combined\n") if ($optcheck > 1); + + $main::NULLallowed = 1 if (defined $main::options{'N'}); + $main::configuration{'cmd_prefix'} = $main::options{'p'} if (defined $main::options{'p'}); + + $main::multidoc_cnt = 0; + $main::multidoc = (defined $main::options{'m'} || defined $main::options{'M'}); + $main::multidoc_id = ''; + + if ($main::multidoc) { + $main::multidoc_id = '_#M#'; + if (defined $main::options{'M'}) { + $main::multidoc_id = '_#P#' + } + } + + if (defined $main::options{'l'}) { + warn "Option '-l' is obsolete, use '-c <location>' instead"; + delete $main::options{'l'}; + } +} + +##### +# Print the Usage: line on errors and after the '-h' switch +# +sub short_help ($) { + my $onerror = shift; + my $helptext = "usage: sqltex [options] <file[.$main::configuration{'texex'}]> [parameter...]\n"; + $helptext .= " type \"sqltex -h\" for help\n" if ($onerror); + return ($helptext); +} + + +##### +# Print full help and after the '-h' switch +# +sub print_help { + my $helptext = &short_help (0); + + $helptext .= " Options:\n"; + if ($main::ext_cfgfile_allowed) { + $helptext .= " --configfile <file>\n"; + $helptext .= " -c <file>\n"; + $helptext .= " SQLTeX configuration file.\n"; + $helptext .= " Default is \'$main::config_location/SQLTeX.cfg\'.\n\n"; + } + $helptext .= " --file-extension <string>\n"; + $helptext .= " -E <string>\n"; + $helptext .= " replace input file extension in outputfile:\n"; + $helptext .= " \'input.tex\' will be \'input.string\'\n"; + $helptext .= " For further notes, see option \'--filename-extend\' below\n\n"; + + $helptext .= " --null-allowed\n"; + $helptext .= " -N\n"; + $helptext .= " NULL return values allowed. By default SQLTeX exits if a\n"; + $helptext .= " query returns an empty set\n\n"; + + $helptext .= " --password [password]\n"; + $helptext .= " -P [password]\n"; + $helptext .= " database password. The value is optional; if omitted, SQLTeX will prompt for\n"; + $helptext .= " a password. This overwrites the password in the input file.\n\n"; + + $helptext .= " --username <user>\n"; + $helptext .= " -U <user>\n"; + $helptext .= " database username\n\n"; + + $helptext .= " --version\n"; + $helptext .= " -V\n"; + $helptext .= " print version number and exit\n\n"; + + $helptext .= " --filename-extend <string>\n"; + $helptext .= " -e <string>\n"; + $helptext .= " add string to the output filename:\n"; + $helptext .= " \'input.tex\' will be \'inputstring.tex\'\n"; + $helptext .= " In \'string\', the values between curly braces \{\}\n"; + $helptext .= " will be substituted:\n"; + $helptext .= " Pn parameter n\n"; + $helptext .= " M current monthname (Mon)\n"; + $helptext .= " W current weekday (Wdy)\n"; + $helptext .= " D current date (yyyymmdd)\n"; + $helptext .= " DT current date and time (yyyymmddhhmmss)\n"; + $helptext .= " T current time (hhmmss)\n"; + $helptext .= " e.g., the command \'sqltex --filename-extend _{P1}_{W} my_file code\'\n"; + $helptext .= " will read \'my_file.tex\' and write \'myfile_code_Tue.tex\'\n"; + $helptext .= " The same command, but with option \--file-extension\' would create the\n"; + $helptext .= " outputfile \'myfile._code_Tue\'\n"; + $helptext .= " By default the outputfile \'myfile_stx.tex\' would have been written.\n"; + $helptext .= " The options \'--file-extension\' and \'--filename-extend\' cannot be used\n"; + $helptext .= " together or with \'--output\'.\n\n"; + + $helptext .= " --force\n"; + $helptext .= " -f\n"; + $helptext .= " force overwrite of existing files\n\n"; + + $helptext .= " --help\n"; + $helptext .= " -h\n"; + $helptext .= " print this help message and exit\n\n"; + + $helptext .= " --multidoc-numbered\n"; + $helptext .= " -m\n"; + $helptext .= " Multidocument mode; create one document for each parameter that is retrieved\n"; + $helptext .= " from the database in the input document (see documentation)\n"; + $helptext .= " This option cannot be used with \'--output\'.\n\n"; + + $helptext .= " --multidoc-named\n"; + $helptext .= " -M\n"; + $helptext .= " Same as -m, but with the parameter in the filename i.s.o. a serial number\n\n"; + + $helptext .= " --output <file>\n"; + $helptext .= " -o <file>\n"; + $helptext .= " specify an output file. Cannot be used with \'--file-extension\',\n"; + $helptext .= " \'--filename-extend\' or the \'--multidoc\' options.\n\n"; + + $helptext .= " --skip-empty-lines\n"; + $helptext .= " -S\n"; + $helptext .= " All SQLTeX commands will be removed from the input line or replaced by the\n"; + $helptext .= " corresponding value. The rest of the input line is written to the output file.\n"; + $helptext .= " This includes lines that only contain a SQLTeX command (and a newline character).\n"; + $helptext .= " This will result in an empty line in the output file.\n"; + $helptext .= " By specifying this option, these empty lines will be skipped. Lines that were empty\n"; + $helptext .= " in the input will be written.\n\n"; + + $helptext .= " --write-comments\n"; + $helptext .= " -C\n"; + $helptext .= " LaTeX comments in the input file will be skipped by default. With this option,\n"; + $helptext .= " comments will also be copied to the output file.\n\n"; + + $helptext .= " --prefix <prefix>\n"; + $helptext .= " -p <prefix>\n"; + $helptext .= " prefix used in the SQLTeX file. Default is \'sql\'\n"; + $helptext .= " (e.g. \\sqldb[user]{database}), but this can be overwritten if it conflicts\n"; + $helptext .= " with other user-defined commands.\n\n"; + + $helptext .= " --quiet\n"; + $helptext .= " -q\n"; + $helptext .= " run in quiet mode\n\n"; + + $helptext .= " --replacementfile <file>\n"; + $helptext .= " -r <file>\n"; + $helptext .= " specify a file that contains replace characters. This is a list with two tab-separated\n"; + $helptext .= " fields per line. The first field holds a string that will be replaced in the SQL output\n"; + $helptext .= " by the second string.\n"; + $helptext .= " By default the file \'$main::config_location/SQLTeX_r.dat\' is used.\n"; + $helptext .= " This default file will still be read after the given replacement file, unless support for\n"; + $helptext .= " multiple replacement files is disabled in the configuration.\n\n"; + + $helptext .= " --no-replacementfile\n"; + $helptext .= " -R\n"; + $helptext .= " do not use a replace file. \'--replacementfile\' \'--no-replacementfile\' are handled\n"; + $helptext .= " in the same order as they appear on the command line.\n"; + $helptext .= " For backwards compatibility, -rn is also still supported.\n\n"; + + $helptext .= " --sqlserver <server>\n"; + $helptext .= " -s <server>\n"; + $helptext .= " SQL server to connect to. Default is \'localhost\'\n\n"; + + $helptext .= " --updates\n"; + $helptext .= " -u\n"; + $helptext .= " If the input file contains updates, execute them.\n\n"; + + $helptext .= " file is the input file that should be read. By default,\n"; + $helptext .= " sqltex looks for a file with extension \'.$main::configuration{'texex'}\'.\n\n"; + $helptext .= " parameter(s) are substituted in the SQL statements if they contain\n"; + $helptext .= " the string \$PAR[x] somewhere in the statement, where\n"; + $helptext .= " \'x\' is the number of the parameter.\n"; + + print $helptext; +} + +##### +# Print the version number +# +sub print_version { + print "sqltex v$main::version - $main::rdate\n"; +} + +##### +# If we're not running in quiet mode (-q), this routine prints a message telling +# the user what's going on. +# +sub print_message ($) { + my $message = shift; + print "$message\n" unless (defined $main::options{'q'}); +} + + +##### +# If we have to prompt for a password, disable terminal echo, get the password +# and return it to the caller +# +sub get_password ($$) { + my ($usr, $srv) = @_; + + my $pwd = ""; + + my $q = "Password for $usr\@$srv : "; + if ($main::ReadKey_available) { + print $q; + ReadMode(4); + while(ord(my $keyStroke = ReadKey(0)) != 10) { + if(ord($keyStroke) == 127 || ord($keyStroke) == 8) { # DEL/Backspace + chop($pwd); + print "\b \b"; + } elsif(ord($keyStroke) >= 32) { # Skip control characters + $pwd = $pwd . $keyStroke; + print '*'; + } + } + ReadMode(0); + print "\n"; + } else { + if ($main::configuration{'allow_readable_pwd'}) { + print $q; + $pwd = <STDIN>; + chomp $pwd; + } else { + die "Cannot ask for password. Either install the Term::ReadKey module or set 'allow_readable_pwd' to 1 in the configuration"; + } + } + return $pwd; +} + +##### +# If we have to prompt for a user. Get it and return it to the caller +# +sub get_username ($) { + my $srv = shift; + + print "Username at $srv : "; + + my $usr = <STDIN>; + chomp $usr; + return $usr; +} + + +####### +# Find the file extension for the outputfile +# +sub file_extension ($) { + my $subst = shift; + + my %mn = ('Jan','01', 'Feb','02', 'Mar','03', 'Apr','04', + 'May','05', 'Jun','06', 'Jul','07', 'Aug','08', + 'Sep','09', 'Oct','10', 'Nov','11', 'Dec','12' ); + my $sydate = localtime (time); + my ($wday, $mname, $dnum, $time, $year) = split(/\s+/,$sydate); + $dnum = "0$dnum" if ($dnum < 10); + while ($subst =~ /\{[a-zA-Z0-9]+\}/) { + my $s1 = $`; + my $sub = $&; + my $s2 = $'; + $sub =~ s/[\{\}]//g; + if ($sub =~ /P[0-9]/) { + $sub =~ s/P//; + die ("insufficient parameters to substitute \{P$sub\}\n") if ($sub > $#ARGV); + $sub = $ARGV[$sub]; + } elsif ($sub eq 'M') { + $sub = $mname; + } elsif ($sub eq 'W') { + $sub = $wday; + } elsif ($sub eq 'D') { + $sub = "$year$mn{$mname}$dnum"; + } elsif ($sub eq 'DT') { + $sub = "$year$mn{$mname}$dnum$time"; + $sub =~ s/://g; + } elsif ($sub eq 'T') { + $sub = $time; + $sub =~ s/://g; + } else { + die ("unknown substitution code \{$sub\}\n"); + } + $subst = "$s1$sub$s2"; + } + return ($subst); +} + +##### +# Find the configuration files +# +sub get_configfiles { + if (defined $main::options{'c'}) { + if (!$main::ext_cfgfile_allowed) { + die "Use of the --configfile option is disallowed by your system administrator"; + } + $main::configurationfile = $main::options{'c'}; + } else { + $main::configurationfile = $main::config_location + . ($main::config_location eq '' ? '' : '/') + . 'SQLTeX.cfg'; + } + if (!-e $main::configurationfile) { + die ("Configfile $main::configurationfile does not exist\n"); + } + + @main::replacefiles = (); + if (!defined $main::options{'R'} && $main::options{'r'} ne "n") { + my $std_replacefile = $main::config_location + . ($main::config_location eq '' ? '' : '/') . 'SQLTeX_r.dat'; + if (!-e $std_replacefile) { + warn ("replace file $std_replacefile does not exist\n"); + $std_replacefile = ""; + } + my $adl_replacefile = ""; + if (defined $main::options{'r'}) { + if (!-e $main::options{'r'}) { + warn ("replace file $main::options{'r'} does not exist\n"); + } else { + $adl_replacefile = $main::options{'r'}; + } + } + my $rf_cnt = 0; + if ($adl_replacefile ne "") { + $main::replacefiles[$rf_cnt++] = $adl_replacefile; + } + if ($std_replacefile ne "") { + $main::replacefiles[$rf_cnt++] = $std_replacefile; + } + } + + return; +} + +##### +# Declare the filenames to use in this run. +# If a file has been entered +# +sub get_filenames { + $main::inputfile = $ARGV[0] || die "no input file specified\n"; + + $main::path = ''; + while ($main::inputfile =~ /\//) { + $main::path .= "$`/"; + $main::inputfile =~ s/$`\///; + } + if ($main::inputfile =~/\./) { + if ((!-e "$main::path$main::inputfile") && (-e "$main::path$main::inputfile.$main::configuration{'texex'}")) { + $main::inputfile .= ".$main::configuration{'texex'}"; + } + } else { + $main::inputfile .= ".$main::configuration{'texex'}" + } + die "File $main::path$main::inputfile does not exist\n" if (!-e "$main::path$main::inputfile"); + + if (!defined $main::options{'o'}) { + $main::inputfile =~ /\./; + $main::outputfile = "$`"; + my $lastext = "$'"; + while ($' =~ /\./) { + $main::outputfile .= ".$`"; + $lastext = "$'"; + } + if (defined $main::options{'E'} || defined $main::options{'e'}) { + $main::configuration{'stx'} = &file_extension ($main::options{'E'} || $main::options{'e'}); + } + if (defined $main::options{'E'}) { + $main::outputfile .= "$main::multidoc_id.$main::configuration{'stx'}"; + } else { + $main::outputfile .= "$main::configuration{'stx'}$main::multidoc_id\.$lastext"; + } + if ($main::configuration{'def_out_is_in'}) { + $main::outputfile = $main::path . $main::outputfile; + } + } else { + $main::outputfile = $main::options{'o'}; + if ($main::configuration{'def_out_is_in'} && !($main::outputfile =~ /\//)) { + $main::outputfile = $main::path . $main::outputfile; + } + } + + return; +} + +##### +# Trim functions +# +sub ltrim { my $s = shift; $s =~ s/^\s+//; return $s; } +sub rtrim { my $s = shift; $s =~ s/\s+$//; return $s; } +sub trim { my $s = shift; return ltrim(rtrim($s)); } + +####### +# Connect to the database +# +sub db_connect($$) { + my ($up, $db) = @_; + state $data_source; + state $gotInput = 0; + + $main::line =~ s/(\[.*?\])?\{$db\}//; + + state $un = ''; + state $pw = ''; + state $hn = ''; + + if (!$gotInput) { + my @opts = split(',', $up); + for(my $idx = 0; $idx <= $#opts; $idx++) { + my $opt = $opts[$idx]; + if ($opt =~ /=/) { + if ($` eq 'user') { + $un = $'; + } elsif ($` eq 'passwd') { + $pw = $'; + } elsif ($` eq 'host') { + $hn = $'; + } + } else { + if ($idx == 0) { + $un = $opt; + } elsif ($idx == 1) { + $pw = $opt; + } elsif ($idx == 2) { + $hn = $opt; + } + } + } + + $un = $main::options{'U'} if (defined $main::options{'U'}); + $un = &get_username($main::options{'s'} || 'localhost') if ($un eq '?'); + + my $promptForPwd = 0; + if (defined $main::options{'P'}) { + if ($main::options{'P'} eq '') { + $promptForPwd = 1; + } else { + $pw = $main::options{'P'} + } + } + if ($pw eq '?') { + $promptForPwd = 1; + } + $pw = &get_password ($un, $main::options{'s'} || 'localhost') if ($promptForPwd); + $gotInput = 1; + + $hn = $main::options{'s'} if (defined $main::options{'s'}); + + if ($main::configuration{'dbdriver'} eq "Pg") { + $data_source = "DBI:$main::configuration{'dbdriver'}:dbname=$db"; + $data_source .= ";host=$hn" unless ($hn eq ""); + } elsif ($main::configuration{'dbdriver'} eq "Oracle") { + $data_source = "DBI:$main::configuration{'dbdriver'}:$db"; + $data_source .= ";host=$hn;sid=$main::configuration{'oracle_sid'}" unless ($hn eq ""); + $data_source .= ";sid=$main::configuration{'oracle_sid'}"; + } elsif ($main::configuration{'dbdriver'} eq "Ingres") { + $data_source = "DBI:$main::configuration{'dbdriver'}"; + $data_source .= ":$hn" unless ($hn eq ""); + $data_source .= ":$db"; + } elsif ($main::configuration{'dbdriver'} eq "Sybase") { + $data_source = "DBI:$main::configuration{'dbdriver'}:$db"; + $data_source .= ";server=$hn" unless ($hn eq ""); + } elsif ($main::configuration{'dbdriver'} eq "ODBC") { + if (!exists ($main::configuration{'odbc_driver'})) { + $main::configuration{'odbc_driver'} = 'SQL Server'; + } + if ($hn eq "") { + $hn = 'localhost'; + } + $data_source = "DBI:ODBC:Driver={$main::configuration{'odbc_driver'}};Server=$hn"; + $data_source .= ";Database=$db"; + $data_source .= ";UID=$un" unless ($un eq ""); + $data_source .= ";PWD=$pw" unless ($pw eq ""); + } else { # MySQL, mSQL, ... + $data_source = "DBI:$main::configuration{'dbdriver'}:database=$db"; + $data_source .= ";host=$hn" unless ($hn eq ""); + } + } + if (!defined $main::options{'q'}) { + my $msg = "Connect to database $db on "; + $msg .= $hn || 'localhost'; + $msg .= " as user $un" unless ($un eq ''); + $msg .= " using a password" unless ($pw eq ''); + &print_message ($msg); + } + if ($main::configuration{'sqlsystem_allowed'}) { + %main::connect_info = ( + 'hn' => $hn + ,'un' => $un + ,'pw' => $pw + ,'db' => $db + ); + } + $main::db_handle = DBI->connect ($data_source, $un, $pw, { RaiseError => 0, PrintError => 1 }) || &signal_message (1); + return; +} + +##### +# Check if the SQL statement contains options +# Supported options are: +# setvar=<i>, where <i> is the list location to store the variable. +# setarr=<i> +# +sub check_options ($) { + my $options = shift; + return if ($options eq ''); + $options =~ s/\[//; + $options =~ s/\]//; + + my @optionlist = split /,/, $options; + while (@optionlist) { + my $opt = shift @optionlist; + if ($opt =~ /^setvar=/i) { + $main::var_no = $'; + $main::setvar = 1; + } + if ($opt =~ /^setarr=/i) { + $main::arr_no = $'; + $main::setarr = 1; + } + if ($opt =~ /^fldsep=/i) { + $main::fldsep = qq{$'}; + $main::fldsep =~ s/NEWLINE/\n/; + } + if ($opt =~ /^rowsep=/i) { + $main::rowsep = qq{$'}; + $main::rowsep =~ s/NEWLINE/\n/; + } + } +} + +##### +# Replace values from the query result as specified in the replace files. +# This is done in two steps, to prevent characters from being replaces again +# if they occus both as key and as value. +# +sub replace_values ($) { + my $sqlresult = shift; + my $rk; + + foreach $rk (@main::repl_order) { + my ($begin, $end) = split /\Q$main::configuration{'rfile_regexploc'}\E/,$main::configuration{'rfile_regexp'}; + if ($rk =~ /^\Q$begin\E(.*)\Q$end\E$/) { + $sqlresult =~ s/$1/$main::repl_key{$rk}/g; + } else { + $sqlresult =~ s/\Q$rk\E/$main::repl_key{$rk}/g; + } + } + + foreach $rk (keys %main::repl_key) { + $sqlresult =~ s/$main::repl_key{$rk}/$main::repl_val{$main::repl_key{$rk}}/g; + } + return ($sqlresult); +} + +##### +# Select multiple rows from the database. This function can have +# the [fldsep=s] and [rowsep=s] options to define the string which +# should be used to separate the fields and rows. +# By default, fields are separated with a comma and blank (', '), and rows +# are separated with a newline character ('\\') +# +sub sql_row ($$) { + my ($options, $query) = @_; + local $main::fldsep = ', '; + local $main::rowsep = "\\\\"; + local $main::setarr = 0; + my (@values, @return_values, $rc, $fc); + + &check_options ($options); + + &print_message ("Retrieving row(s) with \"$query\""); + $main::sql_statements++; + my $stat_handle = $main::db_handle->prepare ($query); + $stat_handle->execute (); + + if ($main::setarr) { + &signal_message (7) if (defined $main::arr[$main::arr_no] && !$main::multidoc); + @main::arr[$main::arr_no] = (); + while (my $ref = $stat_handle->fetchrow_hashref()) { + foreach my $k (keys %$ref) { + $ref->{$k} = replace_values ($ref->{$k}); + } + push @{$main::arr[$main::arr_no]},$ref; + } + $stat_handle->finish (); + return (); + } + + while (@values = $stat_handle->fetchrow_array ()) { + $fc = $#values + 1; + if ($#main::replacefiles >= 0) { + my $list_cnt = 0; + foreach (@values) { + $values[$list_cnt] = replace_values ($values[$list_cnt]); + $list_cnt++; + } + } + push @return_values, (join "$main::fldsep", @values); + } + $stat_handle->finish (); + + if ($#return_values < 0) { + &signal_message (4); + } + + $rc = $#return_values + 1; + if ($rc == 1) { + &print_message ("Found $rc row with $fc field(s)"); + } else { + &print_message ("Found $rc rows with $fc fields each"); + } + + return (join "$main::rowsep", @return_values); + +} + + +##### +# Select a single field from the database. This function can have +# the [setvar=n] option to define an internal variable +# +sub sql_field ($$) { + my ($options, $query) = @_; + local $main::setvar = 0; + + &check_options ($options); + + $main::sql_statements++; + + &print_message ("Retrieving field with \"$query\""); + my $stat_handle = $main::db_handle->prepare ($query); + $stat_handle->execute (); + my @result = $stat_handle->fetchrow_array (); + $stat_handle->finish (); + + if ($#result < 0) { + &signal_message (4); + } elsif ($#result > 0) { + &signal_message (5); + } else { + &print_message ("Found 1 value: \"$result[0]\""); + if ($main::setvar) { + &signal_message (7) if (defined $main::var[$main::var_no] && !$main::multidoc); + $main::var[$main::var_no] = $result[0]; + return ''; + } else { + if ($#main::replacefiles >= 0) { + return (replace_values ($result[0])); + } else { + return ($result[0]); + } + } + } +} + +##### +# Start a section that will be repeated for evey row that is on stack +# +sub sql_start ($) { + my $arr_no = shift; + &signal_message (11) if (!defined $main::arr[$arr_no]); + if (@main::current_array) { + @main::current_array = (); + } + @main::loop_data = (); + push @main::current_array,$arr_no; +} + +##### +# Use a named variable from the stack +# +sub sql_use ($$) { + my ($field, $loop) = @_; + my $return_value = $main::configuration{'no_such_used_fld'}; + if (defined $main::arr[$#main::current_array][$loop]->{$field}) { + $return_value = $main::arr[$#main::current_array][$loop]->{$field}; + } + return $return_value; + +} + + +##### +# Stop processing the current array +# +sub sql_end () { + my $result = ''; + + for (my $cnt = 0; $cnt <= $#{$main::arr[$#main::current_array]}; $cnt++) { + for (my $lines = 0; $lines < $#{$main::loop_data[$#main::current_array]}; $lines++) { + my $buffered_line = ${$main::loop_data[$#main::current_array]}[$lines]; + my $cmdPrefix = $main::configuration{'alt_cmd_prefix'}; + if ($buffered_line =~ s/\\$cmdPrefix$main::configuration{'sql_endif'}\{\}//) { + $main::if_enabled = 1; + } + if ($buffered_line =~ /\\$cmdPrefix$main::configuration{'sql_if'}/) { + my $lin1 = $`; + my $lin2 = $'; + $lin2 =~ s/^\{//; + $lin2 =~ /\}/; + my $statement = $`; + $lin2 = $'; + $main::if_enabled = &sql_if($statement, $cnt); + $buffered_line = $lin1; + if ($main::if_enabled) { + $buffered_line .= $lin2; + } + } + if (!$main::if_enabled) { + next; + } + while (($buffered_line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($buffered_line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) { + my $cmdfound = $&; + $cmdfound =~ s/\\//; + $cmdfound =~ s/\{/\\\{/; + + $buffered_line =~ /\\$cmdfound/; + my $lin1 = $`; + $buffered_line = $'; + $buffered_line =~ /\}/; + my $statement = $`; + my $lin2 = $'; + + if ($cmdfound =~ /$main::configuration{'sql_use'}/) { + $buffered_line = $lin1 . &sql_use($statement, $cnt) . $lin2; + } + } + if ($buffered_line =~ /\\$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_system'}/) { + my $cmdfound = $&; + $cmdfound =~ s/\\//; + $cmdfound =~ s/\{/\\\{/; + + $buffered_line =~ /\\$cmdfound/; + my $lin1 = $`; + $buffered_line = $'; + $buffered_line =~ /\}/; + my $statement = $`; + my $lin2 = $'; + $statement =~ s/^\{//; + + while ($buffered_line =~ /\\$main::configuration{'alt_cmd_prefix'}$main::configuration{'sql_use'}\{(\w+)\}/) { + my $usereplacement = &sql_use($1, $cnt); + $buffered_line =~ s/\\$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_use'}\{(\w+)\}/$usereplacement/; + } + if ($cmdfound =~ /$main::configuration{'sql_system'}/) { + $buffered_line = $lin1 . &sql_system($statement) . $lin2; + } + } + $result .= $buffered_line; + } + } + + pop @main::current_array; + return $result; +} + +##### +# Start a conditional block +# +sub sql_if ($$) { + my ($condition, $cnt) = @_; + if ($condition =~ /(&&|\|\|)/) { + my $c1 = &check_condition($`, $cnt); + my $c2 = &check_condition($', $cnt); + return eval("$c1 $& $c2"); + } else { + return &check_condition($condition, $cnt); + } +} + +##### +# Helper function for sql_if +# +sub check_condition ($$) { + my ($condition, $cnt) = @_; + $condition =~ /(==|!=|<|>|<=|>=)/; + + my $lval = $`; + my $rval = $'; + my $comparisson = $&; + $lval = &trim($lval); + $rval = &trim($rval); + + my $uf = &sql_use($lval, $cnt); + if ($uf ne $main::configuration{'no_such_used_fld'}) { + $lval = $uf; + } + $uf = &sql_use($rval, $cnt); + if ($uf ne $main::configuration{'no_such_used_fld'}) { + $rval = $uf; + } + + my $result = 0; + if ($comparisson eq "==") { + $result = ($lval == $rval); + } elsif ($comparisson eq '!=') { + $result = ($lval != $rval); + } elsif ($comparisson eq '<') { + $result = ($lval < $rval); + } elsif ($comparisson eq '>') { + $result = ($lval > $rval); + } elsif ($comparisson eq '<=') { + $result = ($lval <= $rval); + } elsif ($comparisson eq '>=') { + $result = ($lval >= $rval); + } + return $result; +} + +##### +# Select a list of rows from the database. Each row will be input +# for a document in multidocument mode. +# +sub sql_setparams ($$) { + my ($options, $query) = @_; + my (@values, @return_values); + + &check_options ($options); + + &print_message ("Retrieving parameter list with \"$query\""); + $main::sql_statements++; + my $stat_handle = $main::db_handle->prepare ($query); + $stat_handle->execute (); + + for (my $i = 0; @values = $stat_handle->fetchrow_array (); $i++) { + for ($j = 0; $j <= $#values; $j++) { + $return_values[$i][$j] = $values[$j]; + } + } + + $stat_handle->finish (); + + if ($#return_values < 0) { + &signal_message (8); + } + + &print_message ('Multidocument parameters found; ' . $#return_values+1 ." documents will be created: handle document $main::multidoc_cnt") unless ($main::multidoc_cnt == 0); + + return (@return_values); +} + + +##### +# Perform an update. +# +sub sql_update ($$) { + my ($options, $query) = @_; + local $main::setvar = 0; + + if (!defined $main::options{'u'}) { + &print_message ("Updates will be ignored"); + return; + } + &check_options ($options); + + &print_message ("Updating values with \"$query\""); + my $rc = $main::db_handle->do($query); + &print_message ("$rc rows updated"); +} + +#### +# Call an external script or system command +# +sub sql_system ($) { + my $cmd = shift; + + my $return_value = '\\textbf{use of the \\textbackslash sqlsystem command is disallowed in the configuration}'; + if ($main::configuration{'sqlsystem_allowed'}) { + $cmd =~ s/\<SRV\>/$main::connect_info{'hn'}/; + $cmd =~ s/\<USR\>/$main::connect_info{'un'}/; + $cmd =~ s/\<PWD\>/$main::connect_info{'pw'}/; + $cmd =~ s/\<DB\>/$main::connect_info{'db'}/; + $return_value = `$cmd`; + } + return $return_value; +} + +##### +# Simple error handling +# Files will be closed if opened, and if no sql output was written yet, +# the outputfile will be removed. +# +sub signal_message ($) { + my $step = shift; + my $can_continue = 0; + + $can_continue = 1 if ($step == 4 && $main::NULLallowed); + + if ($step >= 1 && $step <= 2 && !$can_continue) { + unlink ($main::outputfile); + } + + ##### + # Step specific exit + # + my $msg; + if ($step == 1) { + $msg = "noerror opening database at line $main::lcount[$main::fcount]"; + } elsif ($step == 2) { + $msg = "no database opened at line $main::lcount[$main::fcount]"; + } elsif ($step == 3) { + $msg = "insufficient parameters to substitute variable on line $main::lcount[$main::fcount]"; + } elsif ($step == 4) { + $msg = "no result set found on line $main::lcount[$main::fcount]"; + } elsif ($step == 5) { + $msg = "result set too big on line $main::lcount[$main::fcount]"; + } elsif ($step == 6) { + $msg = "trying to substitute with non existing on line $main::lcount[$main::fcount]"; + } elsif ($step == 7) { + $msg = "trying to overwrite an existing variable on line $main::lcount[$main::fcount]"; + } elsif ($step == 8) { + $msg = "no parameters for multidocument found on line $main::lcount[$main::fcount]"; +# } elsif ($step == 9) { +# $msg = "too many fields returned in multidocument mode on $main::lcount[$main::fcount]"; + } elsif ($step == 10) { + $msg = "unrecognized command on line $main::lcount[$main::fcount]"; + } elsif ($step == 11) { + $msg = "start using a non-existing array on line $main::lcount[$main::fcount]"; + } elsif ($step == 12) { + $msg = "\\sqluse command encountered outside loop context on line $main::lcount[$main::fcount]"; + } elsif ($step == 13) { + $msg = "\\sqlif command encountered outside loop context on line $main::lcount[$main::fcount]"; + } + if ($main::fcount > 0) { + for (my $fcnt = 0; $fcnt < $main::fcount; $fcnt++) { + $msg .= ', file included from line '.$main::lcount[$fcnt]; + } + } + warn "$msg\n"; + return if ($can_continue); + exit (1); +} + +##### +# An SQL statement was found in the input file. If multiple lines are +# used for this query, they will be read until the '}' is found, after which +# the query will be executed. +# +sub parse_command ($$$) { + my $cmdfound = shift; + my $multidoc_par = shift; + my $file_handle = shift; + my $options = ''; + my $varallowed = 1; + + $varallowed = 0 if ($cmdfound =~ /$main::configuration{'sql_open'}/); + + chop $cmdfound; + $cmdfound =~ s/\\//; + + $main::line =~ /\\$cmdfound/; + my $lin1 = $`; + $main::line = $'; + + while (!($main::line =~ /\}/)) { + chomp $main::line; + $main::line .= ' '; + $main::line .= <$file_handle>; + $main::lcount[$main::fcount]++; + } + + $main::line =~ /\}/; + my $statement = $`; + my $lin2 = $'; + + my $raw_statement = $statement; + $raw_statement =~ s/^\{//; + $statement =~ s/(\[|\{)//g; + if ($statement =~ /\]/) { + $options = $`; + $statement = $'; + } + if ($varallowed) { + if (($main::multidoc_cnt > 0) && $main::multidoc) { + for (my $i = 1; $i <= $#main::parameters; $i++) { + $statement =~ s/\$MPAR$i/$main::parameters[$main::multidoc_cnt-1][$i-1]/g; + } + } + for (my $i = 1; $i <= $#ARGV; $i++) { + $statement =~ s/\$PAR$i/$ARGV[$i]/g; + } + while ($statement =~ /\$VAR[0-9]/) { + my $varno = $&; + $varno =~ s/\$VAR//; + &signal_message (6) if (!defined ($main::var[$varno])); + $statement =~ s/\$VAR$varno/$main::var[$varno]/g; + } + if ($statement =~ /\$PAR/ && ($main::multidoc_cnt > 0) && $main::multidoc) { + print "Did you update your input file to reflect the changes in v2.2?\n"; + print "Multidoc parameters are now used to replace \$MPARn (was \$PARn).\n"; + print "Please check the documentation for more info.\n"; + die ("No parameters found to replace in multidoc mode"); + } + $statement =~ s/\{//; + } + + $cmdfound =~ s/^$main::configuration{'cmd_prefix'}//; + if ($cmdfound eq $main::configuration{'sql_open'} + ) { + &db_connect($options, $statement); + $main::db_opened = 1; + return 0; + } + + &signal_message (2) if (!$main::db_opened); + if ($cmdfound eq $main::configuration{'sql_field'}) { + $main::line = $lin1 . &sql_field($options, $statement) . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_row'}) { + $main::line = $lin1 . &sql_row($options, $statement) . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_params'}) { + if ($main::multidoc) { # Ignore otherwise + @main::parameters = &sql_setparams($options, $statement); + $main::line = $lin1 . $lin2; + return 1; # Finish this run + } else { + $main::line = $lin1 . $lin2; + } + } elsif ($cmdfound eq $main::configuration{'sql_update'}) { + &sql_update($options, $statement); + $main::line = $lin1 . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_start'}) { + &sql_start($statement); + $main::line = $lin1 . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_use'}) { + &signal_message (12) if (!@main::current_array); + $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_use'} . "{" . $statement . "}" . $lin2; # Restore the line, will be processed later + } elsif ($cmdfound eq $main::configuration{'sql_end'}) { + $main::line = $lin1 . &sql_end() . $lin2; + } elsif ($cmdfound eq $main::configuration{'sql_endif'}) { + $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_endif'} . "{}" . $lin2; # Restore the line, will be processed later + } elsif ($cmdfound eq $main::configuration{'sql_if'}) { + &signal_message (13) if (!@main::current_array); + $main::line = $lin1 . "\\" . $main::configuration{'alt_cmd_prefix'} . $main::configuration{'sql_if'} . "{" . $statement . "}" . $lin2; # Restore the line, will be processed later + } elsif ($cmdfound =~ /$main::configuration{'sql_system'}/) { + $main::line = $lin1 . &sql_system($raw_statement) . $lin2; + } else { + &signal_message (10); + } + return 0; +} + +sub read_input($$$$) { + my ($input_file, $output_handle, $multidoc_par) = @_; + + $main::fcount++; + $main::lcount[$main::fcount] = 0; + + if (!-e $input_file) { + die "input file $input_file not found"; + } + print_message("Processing file $input_file..."); + open (my $fileIn, "<$input_file"); + + while ($main::line = <$fileIn>) { + $main::lcount[$main::fcount]++; + my $line_had_cmd = 0; + + if ($main::line =~ /^\s*%/) { + next if (!$main::options{'C'}); + } else { + if ($main::line =~ /(.*?)(\\in(put|clude))(\s*?)\{(.*?)\}(.*)/) { + print $output_handle "$1" unless ($output_handle == -1); + &read_input($5, $output_handle, $multidoc_par); + return if ($main::restart); + print $output_handle "$6\n" unless ($output_handle == -1); + } + my $cmdPrefix = $main::configuration{'cmd_prefix'}; + if (@main::current_array) { + # Inside loop context the \sqlsystem{} command can contain \sqluse{} + $main::line =~ s/$cmdPrefix$main::configuration{'sql_system'}/$main::configuration{'last_cmd_prefix'}$main::configuration{'sql_system'}/; + } + while (($main::line =~ /\\$cmdPrefix[a-z]+(\[|\{)/) && !($main::line =~ /\\\\$cmdPrefix[a-z]+(\[|\{)/)) { + $line_had_cmd = 1; + if (&parse_command($&, $multidoc_par, $fileIn) && $main::multidoc && ($main::multidoc_cnt == 0)) { + close $fileIn; + $main::fcount--; + $main::restart = 1; + return; + } + } + } + next if ($line_had_cmd && $main::line eq "\n" && $main::options{'S'}); + + if (@main::current_array && $#main::current_array >= 0) { + push @{$main::loop_data[$#main::current_array]}, $main::line; + } else { + print $output_handle "$main::line" unless ($main::multidoc && ($main::multidoc_cnt == 0)); + } + } + $main::fcount--; + close $fileIn; +} + +##### +# Process the input file +# When multiple documents should be written, this routine is +# multiple times. +# The first time, it only builds a list with parameters that will be +# used for the next executions +# +sub process_file { + my $multidoc_par = ''; + + if ($main::multidoc && ($main::multidoc_cnt > 0)) { + if (!defined($main::saved_outfile_template)) { + $main::saved_outfile_template = $main::outputfile; + } + $main::saved_outfile_template = $main::outputfile if ($main::multidoc_cnt == 1); # New global name; should be a static + $main::outputfile = $main::saved_outfile_template if ($main::multidoc_cnt > 1); + $main::outputfile =~ s/\#M\#/$main::multidoc_cnt/; + $main::outputfile =~ s/\#P\#/$main::parameters[($main::multidoc_cnt-1)][0]/; + $multidoc_par = @main::parameters[$main::multidoc_cnt - 1]; + } + my $fileOut; + if ($main::multidoc && ($main::multidoc_cnt == 0)) { + $fileOut = -1; + } else { + open ($fileOut, ">$main::outputfile"); + } + + $main::sql_statements = 0; + $main::db_opened = 0; + $main::fcount = -1; + $main::restart = 0; + + &read_input($main::path . $main::inputfile, $fileOut, $multidoc_par); + + if ($main::multidoc) { + $main::multidoc = 0 if (($main::multidoc_cnt++) > $#main::parameters); + return if ($main::multidoc); + } + + close $fileOut; +} + +## Main: + +##### +# Default config values, can be overwritten with SQLTeX.cfg +# +%main::configuration = ( + 'dbdriver' => 'mysql' + ,'oracle_sid' => 'ORASID' + ,'texex' => 'tex' + ,'stx' => '_stx' + ,'def_out_is_in' => 0 + ,'rfile_comment' => ';' + ,'rfile_regexploc' => '...' + ,'rfile_regexp' => 're(...)' + ,'multi_rfile' => 1 + ,'cmd_prefix' => 'sql' + ,'sql_system' => 'system' + ,'sql_open' => 'db' + ,'sql_field' => 'field' + ,'sql_row' => 'row' + ,'sql_params' => 'setparams' + ,'sql_update' => 'update' + ,'sql_start' => 'start' + ,'sql_end' => 'end' + ,'sql_use' => 'use' + ,'sql_if' => 'if' + ,'sql_endif' => 'endif' + ,'sqlsystem_allowed' => 0 + ,'allow_readable_pwd'=> 0 + ,'repl_step' => 'OSTX' + ,'alt_cmd_prefix' => 'processedsqlcommand' + ,'last_cmd_prefix' => 'lastsqlcommand' + ,'no_such_used_fld' => '\textit{SQL\TeX\ use-field does not exist}' +); + +##### +# Some globals +# +{ + my $realpath = Cwd::realpath($0); + + my @dir_list = split /\//, $realpath; + pop @dir_list; + $main::my_location = join '/', @dir_list; + $main::if_enabled = 1; + + if ($main::my_location =~ /texmf-dist\/scripts/) { + # Config location in a TeX Live distro + $main::config_location = $main::my_location; + } else { + if ($^O eq "linux") { + # Default on linux, can be changed when running configure + $main::config_location = '/usr/local/etc'; + } else { + # Default on al other OSes + $main::config_location = $main::my_location; + } + } +} + +$main::version = '3.0'; +$main::rdate = 'Sep 20, 2024'; + +&parse_options; +&get_configfiles; + +if (defined $main::configurationfile) { + open (CF, "<$main::configurationfile"); + while ($main::line = <CF>) { + next if ($main::line =~ /^\s*#/); + next if ($main::line =~ /^\s*$/); + chomp $main::line; + my ($ck, $cv) = split /=/, $main::line, 2; + $ck =~ s/\s//g; + $cv =~ s/\s//g; + if ($cv ne '') { + $main::configuration{$ck} = $cv; + } + } + close CF; +} + +# Check config +# Used for loops, should not start with $main::configuration{'cmd_prefix'} !! +if ($main::configuration{'alt_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/ + || $main::configuration{'last_cmd_prefix'} =~ /^$main::configuration{'cmd_prefix'}/) { + die "Configuration items 'alt_cmd_prefix' and ĺast_cnd_prefix' cannot start with $main::configuration{'cmd_prefix'}"; +} + +&get_filenames; + +if (!$main::multidoc && -e "$main::outputfile") { + die ("outputfile $main::outputfile already exists\n") + unless (defined $main::options{'f'}); +} + +{ + my $repl_cnt = '000'; + @main::repl_order = (); + for (my $rf_cnt = 0; $rf_cnt <= $#main::replacefiles; $rf_cnt++) { + open (RF, "<$main::replacefiles[$rf_cnt]"); + while ($main::line = <RF>) { + next if ($main::line =~ /^\s*$main::configuration{'rfile_comment'}/); + chomp $main::line; + $main::line =~ s/\t+/\t/; + my ($rk, $rv) = split /\t/, $main::line; + if ($rk ne '') { + push @main::repl_order, $rk; + $main::repl_key{$rk} = "$main::configuration{'repl_step'}$repl_cnt"; + $main::repl_val{"$main::configuration{'repl_step'}$repl_cnt"} = $rv; + $repl_cnt++; + } + } + close RF; + if (!$main::configuration{'multi_rfile'}) { + last; + } + } +} + +# Start processing +do { + &process_file; + $main::restart = 0; + if ($main::sql_statements == 0) { + unlink ("$main::outputfile"); + print "no sql statements found in $main::path$main::inputfile\n"; + $main::multidoc = 0; # Problem in the input, useless to continue + } else { + print "$main::sql_statements queries executed - TeX file $main::outputfile written\n" + unless ($main::multidoc && ($main::multidoc_cnt == 1)); + } +} while ($main::multidoc); # Set to false when done + +$main::db_handle->disconnect() if ($main::db_opened); +exit (0); + +# +# And that's about it. +##### diff --git a/Master/texmf-dist/source/support/sqltex/Makefile.am b/Master/texmf-dist/source/support/sqltex/Makefile.am new file mode 100644 index 00000000000..82bde20e488 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/Makefile.am @@ -0,0 +1,9 @@ +# SQLTeX Automake makefile + +AUTOMAKE_OPTIONS = foreign +SUBDIRS = src man doc + +EXTRA_DIST = README.md SQLTeX.exe + +.PHONY: all-am +all-am: diff --git a/Master/texmf-dist/source/support/sqltex/Makefile.in b/Master/texmf-dist/source/support/sqltex/Makefile.in new file mode 100644 index 00000000000..2284b7696fe --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/Makefile.in @@ -0,0 +1,750 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# SQLTeX Automake makefile +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/aclocal/ax_prog_perl_modules.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in README.md install-sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +SUBDIRS = src man doc +EXTRA_DIST = README.md SQLTeX.exe +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + dist-zstd distcheck distclean distclean-generic distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +.PHONY: all-am +all-am: + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Master/texmf-dist/source/support/sqltex/README.md b/Master/texmf-dist/source/support/sqltex/README.md new file mode 100644 index 00000000000..a99022363a6 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/README.md @@ -0,0 +1,131 @@ +SQLTeX v3.0 +=========== + +**SQLTeX** is a preprocessor to enable the use of SQL statements in LaTeX. It is a +perl script that reads one or more input files containing the SQL commands, and writes a +single LaTeX file or multiple files based on the data read from the database. +Those files can be processed with your LaTeX package. + +The SQL commands will be replaced by their values. It's possible to select a +single field for substitution substitution in your LaTeX document, or to be +used as input in another SQL command. + +### Features ### + +* Replace the SQL statements with their result. This can be a single field, a row or multiple rows, +* Configurable replace file to translate special characters or strings to LaTeX format, with support for regular expressions, +* Use info read from the database as input for new SQL statements, +* Process parts of the LaTeX input file in a loop generating multiple pages or documents, +* Write updates to the database when data has been processed, +* Process parts of the document conditionally using `\sqlif` and `\sqlendif` commands, +* Process data by external scripts and use the output with the `\sqlsystem` command (by default disabled in the config file), + +and more. + +### Supported databases ### + +* MySQL/MariaDB +* Sybase +* Oracle +* PostgreSQL +* MSSQL + +ODBC is supported. + +Others database (Ingres, mSQL, ...) '*should work*'™ but haven´t been tested. + +Installing SQLTeX +----------------- + +Since version 3.0, **SQLTeX** is part of **TeX Live** and doesn't need further installation. + +If you are using a different LaTeX distro, please follow the steps below for your OS. + +### Linux ### + +On a linux system, download the archive and unpack: + + $ tar vxzf sqltex-3.0.tar.gz + $ cd sqltex-3.0 + +Next, install **SQLTeX** with the following commands: + + $ ./configure [options] + $ make + $ sudo make install + +The *options* in `configure` are optional. For an overview of available options +type: + + $ ./configure --help + + +### Other operating systems ### + + +#### Windows #### + +The files `sqltex-3.0\sqltex`, `sqltex-3.0\src\SQLTeX.cfg` and `sqltex-3.0\src\SQLTeX_r.dat` must be placed manually +in the directory of your choice, all in the same directory. + +Since v3.0 the `SQLTeX.EXE` binary is no longer provided in the distribution. + +#### OpenVMS #### + +For other operating systems, there is no install script, you will have to install +it manually. + +On OpenVMS it would be something like: + + $ COPY [.SQLTEX-3_0.SRC]SQLTEX. SYS$SYSTEM:SQLTEX.PL + $ COPY [.SQLTEX-3_0.SRC]SQLTEX.CFG SYS$SYSTEM: + $ COPY [.SQLTEX-3_0.SRC]SQLTEX_R.DAT SYS$SYSTEM: + $ SET FILE/PROTECTION=(W:R) SYS$SYSTEM:SQLTEX*.* + +However, on OpenVMS you also need to define the command SQLTEX by setting a +symbol, either in the LOGIN.COM for all users who need to execute this script, +or in some group-- or system wide login procedure, with the command: + + $ SQLTEX :== "PERL SYS$SYSTEM:SQLTEX.PL" + +Documentation +------------- +Full documentation is in `doc/SQLTeX.pdf`. + +On linux, this file will be placed in `/usr/share/doc/sqltex` by `make install`. +This location can be changed with the _options_ in the `./configure` step. + +Requirements +------------ +* [Perl](http://perl.org/) (>v5.10) +* [Perl-DBI](http://dbi.perl.org/) +* [The DBI driver for your database](http://search.cpan.org/search?query=DBD%3A%3A&mode=module) +* [Getopt::Long](https://metacpan.org/pod/Getopt::Long) +* [Term::ReadKey](https://metacpan.org/pod/Term::ReadKey) + +Note for MAC users +------------------ +If DBI and the database driver are not yet installed, Xtools needs to be +installed in advance, since gcc is not available in a standard install of Mac OS X. + + +Credits +------- +* **Karl Berry** for integration in TeX Live +* **Ingo Reich** for the comment on Mac OS +* **Johan W. Klüwer** for verifying the SyBase support +* **Paolo Cavallini** for adding PostgreSQL support +* **Silpa Suresh** for testing the ODBC support + +---------- + +The **SQLTeX** project is available from [GitHub](https://github.com/oveas/sqltex). + +For bugs, questions and comments, please use the [issue tracker](https://github.com/oveas/sqltex/issues) + +Copyright (c) 2001-2024 - Oscar van Eijk, Oveas Functionality Provider + +This software is subject to the terms of the LaTeX Project Public License; +see [http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html](http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html) + + diff --git a/Master/texmf-dist/source/support/sqltex/SQLTeX.exe b/Master/texmf-dist/source/support/sqltex/SQLTeX.exe Binary files differnew file mode 100644 index 00000000000..c161933ff93 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/SQLTeX.exe diff --git a/Master/texmf-dist/source/support/sqltex/aclocal.m4 b/Master/texmf-dist/source/support/sqltex/aclocal.m4 new file mode 100644 index 00000000000..6d04fca5b5a --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/aclocal.m4 @@ -0,0 +1,753 @@ +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.5], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.5])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <https://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + AM_RUN_LOG([cat conftest.dir/file]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/Master/texmf-dist/source/support/sqltex/aclocal/ax_prog_perl_modules.m4 b/Master/texmf-dist/source/support/sqltex/aclocal/ax_prog_perl_modules.m4 new file mode 100644 index 00000000000..11a326c930c --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/aclocal/ax_prog_perl_modules.m4 @@ -0,0 +1,77 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# Checks to see if the given perl modules are available. If true the shell +# commands in ACTION-IF-TRUE are executed. If not the shell commands in +# ACTION-IF-FALSE are run. Note if $PERL is not set (for example by +# calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl) +# will be run. +# +# MODULES is a space separated list of module names. To check for a +# minimum version of a module, append the version number to the module +# name, separated by an equals sign. +# +# Example: +# +# AX_PROG_PERL_MODULES( Text::Wrap Net::LDAP=1.0.3, , +# AC_MSG_WARN(Need some Perl modules) +# +# LICENSE +# +# Copyright (c) 2009 Dean Povey <povey@wedgetail.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES]) +AC_DEFUN([AX_PROG_PERL_MODULES],[dnl + +m4_define([ax_perl_modules]) +m4_foreach([ax_perl_module], m4_split(m4_normalize([$1])), + [ + m4_append([ax_perl_modules], + [']m4_bpatsubst(ax_perl_module,=,[ ])[' ]) + ]) + +# Make sure we have perl +if test -z "$PERL"; then +AC_CHECK_PROG(PERL,perl,perl) +fi + +if test "x$PERL" != x; then + ax_perl_modules_failed=0 + for ax_perl_module in ax_perl_modules; do + AC_MSG_CHECKING(for perl module $ax_perl_module) + + # Would be nice to log result here, but can't rely on autoconf internals + $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 + if test $? -ne 0; then + AC_MSG_RESULT(no); + ax_perl_modules_failed=1 + else + AC_MSG_RESULT(ok); + fi + done + + # Run optional shell commands + if test "$ax_perl_modules_failed" = 0; then + : + $2 + else + : + $3 + fi +else + AC_MSG_WARN(could not find perl) +fi])dnl diff --git a/Master/texmf-dist/source/support/sqltex/configure b/Master/texmf-dist/source/support/sqltex/configure new file mode 100755 index 00000000000..a5547a09265 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/configure @@ -0,0 +1,3752 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for SQLTeX 3.0. +# +# Report bugs to <support@oveas.com>. +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and support@oveas.com +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='SQLTeX' +PACKAGE_TARNAME='sqltex' +PACKAGE_VERSION='3.0' +PACKAGE_STRING='SQLTeX 3.0' +PACKAGE_BUGREPORT='support@oveas.com' +PACKAGE_URL='' + +ac_subst_vars='LTLIBOBJS +LIBOBJS +PERL +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +' + ac_precious_vars='build_alias +host_alias +target_alias' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures SQLTeX 3.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/sqltex] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of SQLTeX 3.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + +Report bugs to <support@oveas.com>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +SQLTeX configure 3.0 +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by SQLTeX $as_me 3.0, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + + +# Auxiliary files required by this configure script. +ac_aux_files="missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +am__api_version='1.16' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='sqltex' + VERSION='3.0' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: <https://www.gnu.org/software/coreutils/>. + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + + + + + + + + + + + + + +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="perl" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +printf "%s\n" "$PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi + +if test "x$PERL" != x; then + ax_perl_modules_failed=0 + for ax_perl_module in 'DBI' 'DBD::mysql' 'Getopt::Long' 'Term::ReadKey' ; do + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 +printf %s "checking for perl module $ax_perl_module... " >&6; } + + # Would be nice to log result here, but can't rely on autoconf internals + $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 + if test $? -ne 0; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; + ax_perl_modules_failed=1 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; }; + fi + done + + # Run optional shell commands + if test "$ax_perl_modules_failed" = 0; then + : + + else + : + as_fn_error $? "Not all required perl modules are installed" "$LINENO" 5 + + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 +printf "%s\n" "$as_me: WARNING: could not find perl" >&2;} +fi + +# Makefile to be generated in the subdirectories as well +ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile man/Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by SQLTeX $as_me 3.0, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to <support@oveas.com>." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +SQLTeX config.status 3.0 +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/Master/texmf-dist/source/support/sqltex/configure.ac b/Master/texmf-dist/source/support/sqltex/configure.ac new file mode 100644 index 00000000000..058032847bc --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/configure.ac @@ -0,0 +1,31 @@ +# Autoconf configfile for SQLTeX. +# To create a new distribution, execute the following steps: +# aclocal +# autoconf +# automake --add-missing +# ./configure +# make dist +# +# To install: +# ./configure [options] +# make +# [sudo] make install + +AC_PREREQ([2.69]) + +# Ensure configure can check for the required perl modules. +m4_include([aclocal/ax_prog_perl_modules.m4]) + +AC_INIT([SQLTeX], [3.0], [support@oveas.com]) + +AM_INIT_AUTOMAKE + +AX_PROG_PERL_MODULES([DBI DBD::mysql Getopt::Long Term::ReadKey] + , + ,[AC_MSG_ERROR([Not all required perl modules are installed])] +) + +# Makefile to be generated in the subdirectories as well +AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile man/Makefile]) + +AC_OUTPUT diff --git a/Master/texmf-dist/source/support/sqltex/doc/Makefile.am b/Master/texmf-dist/source/support/sqltex/doc/Makefile.am new file mode 100644 index 00000000000..56ee693deda --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/doc/Makefile.am @@ -0,0 +1,17 @@ +# Automake makefile for the documentation + +.PHONY: all + +DISTFILES = Makefile.am Makefile.in SQLTeX.pdf SQLTeX.tex + +all : + +distdir : ${DISTFILES} + cp ${DISTFILES} $(distdir) + +SQLTeX.pdf: SQLTeX.tex + @pdflatex $^ + +install: SQLTeX.pdf + @if [ ! -d ${pdfdir} ]; then mkdir -p ${pdfdir}; fi + cp $^ ${pdfdir} diff --git a/Master/texmf-dist/source/support/sqltex/doc/Makefile.in b/Master/texmf-dist/source/support/sqltex/doc/Makefile.in new file mode 100644 index 00000000000..f42b41992e4 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/doc/Makefile.in @@ -0,0 +1,400 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automake makefile for the documentation +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = doc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/aclocal/ax_prog_perl_modules.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +DISTFILES = Makefile.am Makefile.in SQLTeX.pdf SQLTeX.tex +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +.PHONY: all + +all : + +distdir : ${DISTFILES} + cp ${DISTFILES} $(distdir) + +SQLTeX.pdf: SQLTeX.tex + @pdflatex $^ + +install: SQLTeX.pdf + @if [ ! -d ${pdfdir} ]; then mkdir -p ${pdfdir}; fi + cp $^ ${pdfdir} + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Master/texmf-dist/source/support/sqltex/install-sh b/Master/texmf-dist/source/support/sqltex/install-sh new file mode 100755 index 00000000000..ec298b53740 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/install-sh @@ -0,0 +1,541 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2020-11-14.01; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -p) cpprog="$cpprog -p";; + + -s) stripcmd=$stripprog;; + + -S) backupsuffix="$2" + shift;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/Master/texmf-dist/source/support/sqltex/man/Makefile.am b/Master/texmf-dist/source/support/sqltex/man/Makefile.am new file mode 100644 index 00000000000..59b7d84ee5e --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/man/Makefile.am @@ -0,0 +1,16 @@ +# Automake makefile for the linux manpage + +.PHONY: all distdir +DISTFILES = Makefile.am Makefile.in sqltex.man + +all : + +sqltex.1 : sqltex.man + @cat $^ | sed -e 's#{BINDIR}#$(bindir)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@ + +distdir : ${DISTFILES} + cp ${DISTFILES} $(distdir) + +install: sqltex.1 + @if [ ! -d ${mandir} ]; then mkdir -p ${mandir}; fi + cp $^ ${mandir}/man1 diff --git a/Master/texmf-dist/source/support/sqltex/man/Makefile.in b/Master/texmf-dist/source/support/sqltex/man/Makefile.in new file mode 100644 index 00000000000..d6cdd78baf0 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/man/Makefile.in @@ -0,0 +1,400 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automake makefile for the linux manpage +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = man +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/aclocal/ax_prog_perl_modules.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +DISTFILES = Makefile.am Makefile.in sqltex.man +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +.PHONY: all distdir + +all : + +sqltex.1 : sqltex.man + @cat $^ | sed -e 's#{BINDIR}#$(bindir)#;s#{SYSCONFDIR}#$(sysconfdir)#' > $@ + +distdir : ${DISTFILES} + cp ${DISTFILES} $(distdir) + +install: sqltex.1 + @if [ ! -d ${mandir} ]; then mkdir -p ${mandir}; fi + cp $^ ${mandir}/man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Master/texmf-dist/source/support/sqltex/man/sqltex.man b/Master/texmf-dist/source/support/sqltex/man/sqltex.man new file mode 100644 index 00000000000..8b2915fe77b --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/man/sqltex.man @@ -0,0 +1,164 @@ +.TH SQLTeX 1 "Version 2.2" "LaTeX preprocessor" + +.SH NAME +.B SQLTeX +- a preprocessor to enable the use of SQL statements in LaTeX documents. + +.SH SYNOPSIS +.B sqltex +.RB <INPUT-FILE> +.RB [PARAMETERS] +.RB [OPTIONS] + +.SH DESCRIPTION +.B SQLTeX +is a preprocessor to enable the use of SQL statements in LaTeX. It is a tool that reads +an input file containing the SQL commands, and writes a LaTeX file that can be processed with your +LaTeX package. + +The SQL commands will be replaced by their values. It's possible to select a single field for substitution +substitution in your LaTeX document, or to be used as input in another SQL command. + +For a full description, please refer to the PDF documentation. + +.SH INPUT-FILE +.TP +The input file is required. It is a regular LaTeX file that contains SQLTeX commands for processing. For a detailed description how to create in input files, refer to the SQLTeX documentation. + +.SH PARAMETERS +SQL queries in the input file can contain parameters in the form '$PAR<n>' where <n> is a number between 1 and 9, e.g.: + +.TP +\fB\\sqlrow{SELECT * FROM table WHERE field_s = '$PAR1' AND field_i = $PAR2}\fR + +.TP +These parameters are taken from the commandline. + +.SH OPTIONS + +.IP "\fB-c|--configfile\fP <file>" +SQLTeX configuration file. This option might be disallowed by your systems administrator. + +.IP "\fB-E|--file-extension\fP <string>" +Replace input file extension in outputfile: 'input.tex' will be 'input.string'. +For further notes, see option '--filename-extend' + +.IP "\fB-N|--null-allowed\fP" +NULL return values allowed. By default SQLTeX exits if a query returns an empty set + +.IP "\fB-P|--password\fP [password]" +Database password. The value is optional; if omitted, SQLTeX will prompt for a password. This overwrites the password in the input file. + +.IP "\fB-U|--username\fP user" +Database username + +.IP "\fB-V|--version\fP" +Print version number and exit + +.IP "\fB-e|--filename-extend\fP <string>" +Add string to the output filename: 'input.tex' will be 'inputstring.tex'. In 'string', the values between curly braces {} will be substituted: +.PP +.RS +.IP Pn +parameter n +.IP M +current monthname (Mon) +.IP W +current weekday (Wdy) +.IP D +current date (yyyymmdd) +.IP DT +current date and time (yyyymmddhhmmss) +-IP T +current time (hhmmss) +.RE + +.in +.7i +The options '--file-extension' and '--filename-extend' cannot be used together or with '--output'. +.in + +.IP "\fB-f|--force\fP" +Force overwrite of existing files + +.IP "\fB-h|--help\fP" +Print this help message and exit + +.IP "\fB-m|--multidoc-numbered\fP" +Multidocument mode; create one document for each parameter that is retrieved from the database in the input document (see documentation) +This option cannot be used with '--output'. + +.IP "\fB-M|--multidoc-named\fP" +Same as -m, but with the parameter in the filename i.s.o. a serial number + +.IP "\fB-o|--output\fP <file>" +Specify an output file. Cannot be used with '--file-extension', '--filename-extend' or the '--multidoc' options. + +.IP "\fB-S|--skip-empty-lines" +All SQLTeX commands will be removed from the input line or replaced by the corresponding value. The rest of the input line is written to the output file. +This includes lines that only contain a SQLTeX command (and a newline character). This will result in an empty line in the output file. +By specifying this option, these empty lines will be skipped. Lines that were empty in the input will be written. + +.IP "-C|--write-comments" +LaTeX comments in the input file will be skipped by default. With this option, comments will also be copied to the output file. + +.IP "\fB-p|--prefix\fP <prefix>" +Prefix used in the SQLTeX file. Default is 'sql' (see documentation) + +.IP "\fB-q|--quiet\fP" +Run in quiet mode + +.IP "\fB-r|--replacementfile\fP <file>" +Specify a file that contains replace characters. This is a list with two tab-separated fields per line. The first field holds a string that will be replaced in the SQL output by the second string. + +.IP "\fB-R|-rn|--no-replacementfile\fP" +Do not use a replace file. '--replacementfile' '--no-replacementfile' are handled in the same order as they appear on the command line. + +.IP "\fB-s|--sqlserver\fP <server>" +SQL server to connect to. Default is \'localhost\' + +.IP "\fB-u|--updates\fP" +If the input file contains updates, execute them. + +.SH FILES +.TP +.I +{SYSCONFDIR}/SQLTeX_r.dat +Default replacement file. If your installation is part of TEX Live the file will redisde in the same directory as the sqltex executable +.TP +.I +{SYSCONFDIR}/SQLTeX.cfg +Default configuration file. If your installation is part of TEX Live the file will redisde in the same directory as the sqltex executable +.TP +.I +{BINDIR}/sqltex +The sqltex executable. The location might differ depending on your installation type, e.g. as part if the TEX Live distribution. + +.SH EXAMPLES +.TP +.BI sqltex\ --filename-extend\ _{P1}_{W}\ my_file\ code +.TP +Read input file 'my_file.tex' and generate 'myfile_code_Tue.tex' with the processed results. + +.TP +.BI sqltex\ --file-extension\ _{P1}_{W}\ my_file\ code +.TP +Read input file 'my_file.tex' and generate 'myfile._code_Tue' with the processed results. + +.SH EXIT STATUS +.TP +.B +0 +Success + +.TP +.B +1 +SQLTeX ended with an error, check the last message. + +.SH COPYRIGHT +.PP +Copyright 2001-2024 Oscar van Eijk, Oveas Functionality Provider. +https://oveas.com + +This software is subject to the terms of the LaTeX Project Public License; see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html + diff --git a/Master/texmf-dist/source/support/sqltex/missing b/Master/texmf-dist/source/support/sqltex/missing new file mode 100755 index 00000000000..1fe1611f185 --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/Master/texmf-dist/source/support/sqltex/src/Makefile.am b/Master/texmf-dist/source/support/sqltex/src/Makefile.am new file mode 100644 index 00000000000..bcf72fe6a1b --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/src/Makefile.am @@ -0,0 +1,30 @@ +# Automake makefile for the SQLTeX code and configfiles + +.PHONY: distdir +DATAFILES = SQLTeX_r.dat SQLTeX.cfg +DISTFILES = Makefile.am Makefile.in sqltex ${DATAFILES} + +PL=$(shell which perl) + +all : sqltex.pl + +distdir : ${DISTFILES} + cp $(DISTFILES) $(distdir) + +sqltex.pl: sqltex + cat $^ | sed -e 's#!/usr/bin/env perl#!$(PL)#;s#/usr/local/etc#$(sysconfdir)#' > $@ + @chmod +x $@ + +install : sqltex.pl ${DATAFILES} + @if [ ! -d ${bindir} ]; then mkdir -p ${bindir}; fi + @if [ ! -d ${sysconfdir} ]; then mkdir -p ${sysconfdir}; fi + @if [ -f $(bindir)/SQLTeX ]; then rm $(bindir)/SQLTeX; fi + cp $< $(bindir)/sqltex + ln -s $(bindir)/sqltex $(bindir)/SQLTeX + @$(foreach datafile, $(DATAFILES), \ + if [ -e $(sysconfdir)/$(datafile) ]; \ + then echo 'cp $(datafile) $(sysconfdir)/$(datafile).new'; \ + cp $(datafile) $(sysconfdir)/$(datafile).new; \ + else echo 'cp $(datafile) $(sysconfdir)/$(datafile)'; \ + cp $(datafile) $(sysconfdir)/$(datafile); \ + fi;) diff --git a/Master/texmf-dist/source/support/sqltex/src/Makefile.in b/Master/texmf-dist/source/support/sqltex/src/Makefile.in new file mode 100644 index 00000000000..588ef0464df --- /dev/null +++ b/Master/texmf-dist/source/support/sqltex/src/Makefile.in @@ -0,0 +1,413 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Automake makefile for the SQLTeX code and configfiles +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/aclocal/ax_prog_perl_modules.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +DATAFILES = SQLTeX_r.dat SQLTeX.cfg +DISTFILES = Makefile.am Makefile.in sqltex ${DATAFILES} +PL = $(shell which perl) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +.PHONY: distdir + +all : sqltex.pl + +distdir : ${DISTFILES} + cp $(DISTFILES) $(distdir) + +sqltex.pl: sqltex + cat $^ | sed -e 's#!/usr/bin/env perl#!$(PL)#;s#/usr/local/etc#$(sysconfdir)#' > $@ + @chmod +x $@ + +install : sqltex.pl ${DATAFILES} + @if [ ! -d ${bindir} ]; then mkdir -p ${bindir}; fi + @if [ ! -d ${sysconfdir} ]; then mkdir -p ${sysconfdir}; fi + @if [ -f $(bindir)/SQLTeX ]; then rm $(bindir)/SQLTeX; fi + cp $< $(bindir)/sqltex + ln -s $(bindir)/sqltex $(bindir)/SQLTeX + @$(foreach datafile, $(DATAFILES), \ + if [ -e $(sysconfdir)/$(datafile) ]; \ + then echo 'cp $(datafile) $(sysconfdir)/$(datafile).new'; \ + cp $(datafile) $(sysconfdir)/$(datafile).new; \ + else echo 'cp $(datafile) $(sysconfdir)/$(datafile)'; \ + cp $(datafile) $(sysconfdir)/$(datafile); \ + fi;) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index b4758c3a93a..09c69641266 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -794,7 +794,7 @@ my @TLP_working = qw( spacekern spacingtricks spalign spark-otf sparklines spath3 spbmark spectral spectralsequences spelatex spelling spie spix sphack sphdthesis splines splitbib splitindex - spot spotcolor spreadtab spverbatim + spot spotcolor spreadtab spverbatim sqltex sr-vorl srbook-mem srbtiks srcltx srdp-mathematik srcredact sseq sslides stack stackengine stage standalone standardsectioning stanli starfont startex diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index b9be6f84897..2695e25956a 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1352,7 +1352,6 @@ chomp (my $ctan_root = `tlpkginfo --ctan-root`); 'splint', "die 'skipping, binary'", 'springer', "die 'skipping, licenses not checked'", 'sprite', "die 'skipping, noinfo license'", - 'sqltex', "die 'skipping, not self-locating'", 'srbtiks', "&MAKEflatten", 'ssqquote', "die 'skipping, nonfree license'", 'startlatex2e',"die 'skipping, renamed to yet-another-guide-latex2e'", @@ -1885,6 +1884,7 @@ chomp (my $ctan_root = `tlpkginfo --ctan-root`); 'simple-resume-cv' => '&POST_simple_rmFonts', 'simple-thesis-dissertation' => '&POST_simple_rmFonts', 'splitindex' => '&POST_do_man', + 'sqltex', => '&POSTsqltex', 'starray' => '&POST_onelevel', 'startex' => '&POST_otherformat', 'stex', => '&POSTstex', @@ -3137,6 +3137,7 @@ $standardsource = '(\.(bat|c|drv|[dem]tx|fea|fdd|ins|mk|sfd)' 'ruhyphen', '^[^.]*$|README.ru|hyphen.rules', 'selnolig', 'NULL', # not .fea 'shipunov', 'NULL', # .bat in scripts + 'sqltex', '.', 'stex', 'NULL', # handled in post fn 'tds', 'NULL', # doc pkg 'tex-vpat', 'NULL', @@ -3876,6 +3877,7 @@ $standardttf = '\.ttf|\.TTC'; 'rubik' => '\.pl$', 'runtexshebang' => '\.lua$', 'spix' => '\.py$', + 'sqltex' => 'sqltex$', 'srcredact' => '\.pl$', 'splitindex' => 'splitindex\.pl$', 'sty2dtx' => '\.pl$', @@ -6798,7 +6800,7 @@ sub POSTbibtex { } sub POSTbibtexperllibs { - print "POST$package - move modules to scripts/, man pages to doc/\n"; + print "POST$package - move modules to scripts/, man pages to doc/, etc.\n"; &xchdir ("$DEST/source/support/$package/"); &mv_with_mkdir ("*/lib/*", "$DEST/scripts/$package/"); # @@ -7830,6 +7832,30 @@ sub POST_simple_rmFonts { &SYSTEM ("$RM -r Fonts"); } +sub POSTsqltex { + print "POST$package - move script to scripts/, man pages to doc/, etc.\n"; + &xchdir ("$DEST/source/support/$package/"); + # + # The user-level script, and accompanying data files, are in a subdir. + # Don't move Makefile.*. + &mv_with_mkdir ("src/[sS]*", "$DEST/scripts/$package/"); + # + &xchdir ("$DEST/scripts/$package/"); + @filenames = glob ("*"); # have to reset @filenames for install() + &doscripts (); + # + # Move the doc files to the doc tree. Don't move Makefile.*. + &xchdir ("$DEST/source/support/$package"); + my $docdest = "$DEST/doc/support/$package"; + &mv_with_mkdir ("doc/S*", $docdest); + &domans (); + # + # The man page is in a different subdir. + &xchdir ("man"); + @filenames = glob ("*.man"); # have to reset @filenames for install() + &domans (); +} + sub POSTstex { print "POST$package - mv tex/ dir, copy source/ dir\n"; diff --git a/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc index f05a7edd868..35a54dad764 100644 --- a/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc @@ -85,6 +85,7 @@ depend pythontex depend runtexshebang depend seetexk depend spix +depend sqltex depend srcredact depend sty2dtx depend synctex diff --git a/Master/tlpkg/tlpsrc/sqltex.tlpsrc b/Master/tlpkg/tlpsrc/sqltex.tlpsrc new file mode 100644 index 00000000000..dca338c719c --- /dev/null +++ b/Master/tlpkg/tlpsrc/sqltex.tlpsrc @@ -0,0 +1 @@ +binpattern f bin/${ARCH}/${PKGNAME} |