gpp-2.24/0000777000076400001440000000000010123366423005774 5gpp-2.24/doc/0000777000076400001440000000000010123366423006541 5gpp-2.24/doc/gpp.10000644000076400001440000014603410123364565007342 .TH GPP 1 \" -*- nroff -*- .SH NAME GPP \- Generic Preprocessor .SH SYNOPSIS gpp [\-{o|O} \fIoutfile\fP] [\-I\fI/include/path\fP] [\-D\fIname=val\fP ...] [\-z|+z] [\-x] [\-m] [\-C|\-T|\-H|\-X|\-P|\-U ... [\-M ...]] [\-n|+n] [+c\fI\fP \fIstr1\fP \fIstr2\fP] [+s\fI\fP \fIstr1\fP \fIstr2\fP \fIc\fP] [\-c \fIstr1\fP] [\-\-nostdinc] [\-\-nocurinc] [\-\-curdirinclast] [\-\-warninglevel \fIn\fP] [\-\-includemarker \fIstr\fP] [\-\-include \fIfile\fP] [\fIinfile\fP] gpp \-\-help gpp \-\-version .SH DESCRIPTION .P GPP is a general-purpose preprocessor with customizable syntax, suitable for a wide range of preprocessing tasks. Its independence from any programming language makes it much more versatile than cpp, while its syntax is lighter and more flexible than that of m4. .P GPP is targeted at all common preprocessing tasks where cpp is not suitable and where no very sophisticated features are needed. In order to be able to process equally efficiently text files or source code in a variety of languages, the syntax used by GPP is fully customizable. The handling of comments and strings is especially advanced. .P Initially, GPP only understands a minimal set of built-in macros, called \fImeta-macros\fP. These meta-macros allow the definition of \fIuser macros\fP as well as some basic operations forming the core of the preprocessing system, including conditional tests, arithmetic evaluation, wildcard matching (globbing), and syntax specification. All user macro definitions are global -- \fIi.e.\fP, they remain valid until explicitly removed; meta-macros cannot be redefined. With each user macro definition GPP keeps track of the corresponding syntax specification so that a macro can be safely invoked regardless of any subsequent change in operating mode. .P In addition to macros, GPP understands comments and strings, whose syntax and behavior can be widely customized to fit any particular purpose. Internally comments and strings are the same construction, so everything that applies to comments applies to strings as well. .SH OPTIONS .P GPP recognizes the following command-line switches and options. Note that the \-nostdinc, \-nocurinc, \-curdirinclast, \-warninglevel, and \-includemarker options from version 2.1 and earlier are deprecated and should not be used. Use the "long option" variants instead (\-\-nostdinc, \fIetc.\fP). .TP .BI "\-h \-\-help" "" Print a short help message. .TP .BI "\-\-version" "" Print version information. .TP .BI "\-o " "outfile" Specify a file to which all output should be sent (by default, everything is sent to standard output). .TP .BI "\-O " "outfile" Specify a file to which all output should be sent; output is simultanously sent to stdout. .TP .BI "\-I" "/include/path" Specify a path where the \fI#include\fP meta-macro will look for include files if they are not present in the current directory. The default is /usr/include if no \-I option is specified. Multiple \-I options may be specified to look in several directories. .TP .BI "\-D" "name=val" Define the user macro \fIname\fP as equal to \fIval\fP. This is strictly equivalent to using the \fI#define\fP meta-macro, but makes it possible to define macros from the command-line. If \fIval\fP makes references to arguments or other macros, it should conform to the syntax of the mode specified on the command-line. Starting with version 2.1, macro argument naming is allowed on the command-line. The syntax is as follows: \-D\fImacro\fP(\fIarg1\fP,...)=\fIdefinition\fP. The arguments are specified in C-style syntax, without any whitespace, but the definition should still conform to the syntax of the mode specified on the command-line. .TP .BI "+z" "" Set text mode to Unix mode (LF terminator). Any CR character in the input is systematically discarded. This is the default under Unix systems. .TP .BI "\-z" "" Set text mode to DOS mode (CR-LF terminator). In this mode all CR characters are removed from the input, and all output LF characters are converted to CR-LF. This is the default if GPP is compiled with the WIN_NT option. .TP .BI "\-x" "" Enable the use of the \fI#exec\fP meta-macro. Since \fI#exec\fP includes the output of an arbitrary shell command line, it may cause a potential security threat, and is thus disabled unless this option is specified. .TP .BI "\-m" "" Enable automatic mode switching to the cpp compatibility mode if the name of an included file ends in `.h' or `.c'. This makes it possible to include C header files with only minor modifications. .TP .BI "\-n" "" Prevent newline or whitespace characters from being removed from the input when they occur as the end of a macro call or of a comment. By default, when a newline or whitespace character forms the end of a macro or a comment it is parsed as part of the macro call or comment and therefore removed from output. Use the \-n option to keep the last character in the input stream if it was whitespace or a newline. This is activated in cpp and Prolog modes. .TP .BI "+n" "" The opposite of \-n. This is the default in all modes except cpp and Prolog. Note that +n must be placed \fIafter\fP \-C or \-P in order to have any effect. .TP .BI "\-U " "arg1 ... arg9" User-defined mode. The nine following command-line arguments are taken to be respectively the macro start sequence, the macro end sequence for a call without arguments, the argument start sequence, the argument separator, the argument end sequence, the list of characters to stack for argument balancing, the list of characters to unstack, the string to be used for referring to an argument by number, and finally the quote character (if there is none an empty string should be provided). These settings apply both to user macros and to meta-macros, unless the \-M option is used to define other settings for meta-macros. See the section on syntax specification for more details. .TP .BI "\-M " "arg1 ... arg7" User-defined mode specifications for meta-macros. This option can only be used together with \-M. The seven following command-line arguments are taken to be respectively the macro start sequence, the macro end sequence for a call without arguments, the argument start sequence, the argument separator, the argument end sequence, the list of characters to stack for argument balancing, and the list of characters to unstack. See below for more details. .TP .BI "(default mode)" "" The default mode is a vaguely cpp-like mode, but it does not handle comments, and presents various incompatibilities with cpp. Typical meta-macros and user macros look like this: #define x y macro(arg,...) This mode is equivalent to -U "" "" "(" "," ")" "(" ")" "#" "\\\\" -M "#" "\\n" " " " " "\\n" "(" ")" .TP .BI "\-C" "" cpp compatibility mode. This is the mode where GPP's behavior is the closest to that of cpp. Unlike in the default mode, meta-macro expansion occurs only at the beginning of lines, and C comments and strings are understood. This mode is equivalent to -n -U "" "" "(" "," ")" "(" ")" "#" "" -M "\\n#\\w" "\\n" " " " " "\\n" "" "" +c "/*" "*/" +c "//" "\\n" +c "\\\\\\n" "" +s "\\"" "\\"" "\\\\" +s "'" "'" "\\\\" .TP .BI "\-T" "" TeX-like mode. In this mode, typical meta-macros and user macros look like this: \\define{x}{y} \\macro{arg}{...} No comments are understood. This mode is equivalent to -U "\\\\" "" "{" "}{" "}" "{" "}" "#" "@" .TP .BI "\-H" "" HTML-like mode. In this mode, typical meta-macros and user macros look like this: <#define x|y> <#macro arg|...> No comments are understood. This mode is equivalent to -U "<#" ">" "\\B" "|" ">" "<" ">" "#" "\\\\" .TP .BI "\-X" "" XHTML-like mode. In this mode, typical meta-macros and user macros look like this: <#define x|y/> <#macro arg|.../> No comments are understood. This mode is equivalent to -U "<#" "/>" "\\B" "|" "/>" "<" ">" "#" "\\\\" .TP .BI "\-P" "" Prolog-compatible cpp-like mode. This mode differs from the cpp compatibility mode by its handling of comments, and is equivalent to -n -U "" "" "(" "," ")" "(" ")" "#" "" -M "\\n#\\w" "\\n" " " " " "\\n" "" "" +ccss "\\!o/*" "*/" +ccss "%" "\\n" +ccii "\\\\\\n" "" +s "\\"" "\\"" "" +s "\\!#'" "'" "" .TP .BI "+c" " str1 str2" Specify comments. Any unquoted occurrence of \fIstr1\fP will be interpreted as the beginning of a comment. All input up to the first following occurrence of \fIstr2\fP will be discarded. This option may be used multiple times to specify different types of comment delimiters. The optional parameter \fI\fP can be specified to alter the behavior of the comment and, \fIe.g.\fP, turn it into a string or make it ignored under certain circumstances, see below. .TP .BI "\-c " "str1" Un-specify comments or strings. The comment/string specification whose start sequence is \fIstr1\fP is removed. This is useful to alter the built-in comment specifications of a standard mode -- \fIe.g.\fP, the cpp compatibility mode. .TP .BI "+s" " str1 str2 c" Specify strings. Any unquoted occurrence of \fIstr1\fP will be interpreted as the beginning of a string. All input up to the first following occurrence of \fIstr2\fP will be output as is without any evaluation. The delimiters themselves are output. If \fIc\fP is non-empty, its first character is used as a \fIstring-quote character\fP -- \fIi.e.\fP, a character whose presence immediately before an occurrence of \fIstr2\fP prevents it from terminating the string. The optional parameter \fI\fP can be specified to alter the behavior of the string and, \fIe.g.\fP, turn it into a comment, enable macro evaluation inside the string, or make the string specification ignored under certain circumstances. See below. .TP .BI "\-s " "str1" Un-specify comments or strings. Identical to \-c. .TP .BI "\-\-include " "file" Process \fIfile\fP before \fIinfile\fP .TP .BI "\-\-nostdinc" "" Do not look for include files in the standard directory /usr/include. .TP .BI "\-\-nocurinc" "" Do not look for include files in the current directory. .TP .BI "\-\-curdirinclast" "" Look for include files in the current directory \fIafter\fP the directories specified by \fI\-I\fP rather than before them. .TP .BI "\-\-warninglevel " "n" Set warning level to \fIn\fP (0, 1 or 2). Default is 2 (most verbose). .TP .BI "\-\-includemarker " "str" keep track of \fI#include\fP directives by inserting a marker in the output stream. The format of the marker is determined by \fIstr\fP, which must contain three occurrences of the character \fI%\fP (or equivalently \fI?\fP). The first occurrence is replaced with the line number, the second with the file name, and the third with 1, 2 or blank. When this option is specified in default, cpp or Prolog mode, GPP does its best to ensure that line numbers are the same in the output as in the input by inserting blank lines in the place of definitions or comments. .TP .BI "infile" "" Specify an input file from which GPP reads its input. If no input file is specified, input is read from standard input. .SH SYNTAX SPECIFICATION .P The syntax of a macro call is as follows: it must start with a sequence of characters matching the \fImacro start sequence\fP as specified in the current mode, followed immediately by the name of the macro, which must be a valid \fIidentifier\fP -- \fIi.e.\fP, a sequence of letters, digits, or underscores ("_"). The macro name must be followed by a \fIshort macro end sequence\fP if the macro has no arguments, or by a sequence of arguments initiated by an \fIargument start sequence\fP. The various arguments are then separated by an \fIargument separator\fP, and the macro ends with a \fIlong macro end sequence\fP. .P In all cases, the parameters of the current context -- \fIi.e.\fP, the arguments passed to the body being evaluated -- can be referred to by using an \fIargument reference sequence\fP followed by a digit between 1 and 9. Alternatively, macro parameters may be named (see below). Furthermore, to avoid interference between the GPP syntax and the contents of the input file, a \fIquote character\fP is provided. The quote character can be used to prevent the interpretation of a macro call, comment, or string as anything but plain text. The quote character "protects" the following character, and always gets removed during evaluation. Two consecutive quote characters evaluate as a single quote character. .P Finally, to facilitate proper argument delimitation, certain characters can be "stacked" when they occur in a macro argument, so that the argument separator or macro end sequence are not parsed if the argument body is not balanced. This allows nesting macro calls without using quotes. If an improperly balanced argument is needed, quote characters should be added in front of some stacked characters to make it balanced. .P The macro construction sequences described above can be different for meta-macros and for user macros: this is the case in cpp mode, for example. Note that, since meta-macros can only have up to two arguments, the delimitation rules for the second argument are somewhat sloppier, and unquoted argument separator sequences are allowed in the second argument of a meta-macro. .P Unless one of the standard operating modes is selected, the above syntax sequences can be specified either on the command-line, using the \-M and \-U options respectively for meta-macros and user macros, or inside an input file via the \fI#mode meta\fP and \fI#mode user\fP meta-macro calls. In both cases the mode description consists of nine parameters for user macro specifications, namely the macro start sequence, the short macro end sequence, the argument start sequence, the argument separator, the long macro end sequence, the string listing characters to stack, the string listing characters to unstack, the argument reference sequence, and finally the quote character. As explained below, these sequences should be supplied using the syntax of C strings; they must start with a non-alphanumeric character, and in the first five strings special matching sequences can be used (see below). If the argument corresponding to the quote character is the empty string, that argument's functionality is disabled. For meta-macro specifications there are only seven parameters, as the argument reference sequence and quote character are shared with the user macro syntax. .P The structure of a comment/string is as follows: it must start with a sequence of characters matching the given \fIcomment/string start sequence\fP, and always ends at the first occurrence of the \fIcomment/string end sequence\fP, unless it is preceded by an odd number of occurrences of the \fIstring-quote character\fP (if such a character has been specified). In certain cases comment/strings can be specified to enable macro evaluation inside the comment/string; in that case, if a quote character has been defined for macros it can be used as well to prevent the comment/string from ending, with the difference that the macro quote character is always removed from output whereas the string-quote character is always output. Also note that under certain circumstances a comment/string specification can be \fIdisabled\fP, in which case the comment/string start sequence is simply ignored. Finally, it is possible to specify a \fIstring warning character\fP whose presence inside a comment/string will cause GPP to output a warning (this is useful to locate unterminated strings in cpp mode). Note that input files are not allowed to contain unterminated comments/strings. .P A comment/string specification can be declared from within the input file using the \fI#mode comment\fP meta-macro call (or equivalently \fI#mode string\fP), in which case the number of C strings to be given as arguments to describe the comment/string can be anywhere between two and four: the first two arguments (mandatory) are the start sequence and the end sequence, and can make use of the special matching sequences (see below). They may not start with alphanumeric characters. The first character of the third argument, if there is one, is used as the string-quote character (use an empty string to disable the functionality), and the first character of the fourth argument, if there is one, is used as the string-warning character. A specification may also be given from the command-line, in which case there must be two arguments if using the +c option and three if using the +s option. .P The behavior of a comment/string is specified by a three-character modifier string, which may be passed as an optional argument either to the +c/+s command-line options or to the \fI#mode comment\fP/\fI#mode string\fP meta-macros. If no modifier string is specified, the default value is "ccc" for comments and "sss" for strings. The first character corresponds to the behavior inside meta-macro calls (including user-macro definitions since these come inside a \fI#define\fP meta-macro call), the second character corresponds to the behavior inside user-macro parameters, and the third character corresponds to the behavior outside of any macro call. Each of these characters can take the following values: .TP .BI "i" "" disable the comment/string specification. .TP .BI "c" "" comment (neither evaluated nor output). .TP .BI "s" "" string (the string and its delimiter sequences are output as-is). .TP .BI "q" "" quoted string (the string is output as-is, without the delimiter sequences). .TP .BI "C" "" evaluated comment (macros are evaluated, but output is discarded). .TP .BI "S" "" evaluated string (macros are evaluated, delimiters are output). .TP .BI "Q" "" evaluated quoted string (macros are evaluated, delimiters are not output). .P Important note: any occurrence of a comment/string start sequence inside another comment/string is always ignored, even if macro evaluation is enabled. In other words, comments/strings cannot be nested. In particular, the `Q' modifier can be a convenient way of defining a syntax for temporarily disabling all comment and string specifications. .P Syntax specification strings should always be provided as C strings, whether they are given as arguments to a \fI#mode\fP meta-macro call or on the command-line of a Unix shell. If command-line arguments are given via another method than a standard Unix shell, then the shell behavior must be emulated -- \fIi.e.\fP, the surrounding "" quotes should be removed, all occurrences of `\\\\' should be replaced by a single backslash, and similarly `\\"' should be replaced by `"'. Sequences like `\\n' are recognized by GPP and should be left as is. .P Special sequences matching certain subsets of the character set can be used. They are of the form `\\\fIx\fP', where \fIx\fP is one of: .TP .BI "b" "" matches any sequence of one or more spaces or tab characters (`\\b' is identical to `\ '). .TP .BI "w" "" matches any sequence of zero or more spaces or tab characters. .TP .BI "B" "" matches any sequence of one or more spaces, tabs or newline characters. .TP .BI "W" "" matches any sequence of zero or more spaces, tabs or newline characters. .TP .BI "a" "" an alphabetic character (`a' to `z' and `A' to `Z'). .TP .BI "A" "" an alphabetic character, or a space, tab or newline. .TP .BI "#" "" a digit (`0' to `9'). .TP .BI "i" "" an identifier character. The set of matched characters is customizable using the \fI#mode charset id\fP command. The default setting matches alphanumeric characters and underscores (`a' to `z', `A' to `Z', `0' to `9' and `_'). .TP .BI "t" "" a tab character. .TP .BI "n" "" a newline character. .TP .BI "o" "" an operator character. The set of matched characters is customizable using the \fI#mode charset op\fP command. The default setting matches all characters in "+-*/\\^<>=`~:.?@#&!%|", except in Prolog mode where `!', `%' and `|' are not matched. .TP .BI "O" "" an operator character or a parenthesis character. The set of additional matched characters in comparison with `\\o' is customizable using the \fI#mode charset par\fP command. The default setting is to have the characters in "()[]{}" as parentheses. .P Moreover, all of these matching subsets except `\\w' and `\\W' can be negated by inserting a `!' -- \fIi.e.\fP, by writing `\\!\fIx\fP' instead of `\\\fIx\fP'. .P Note an important distinctive feature of \fIstart sequences\fP: when the first character of a macro or comment/string start sequence is '\ ' or one of the above special sequences, it is not taken to be part of the sequence itself but is used instead as a context check: for example a start sequence beginning with '\\n' matches only at the beginning of a line, but the matching newline character is not taken to be part of the sequence. Similarly a start sequence beginning with '\ ' matches only if some whitespace is present, but the matching whitespace is not considered to be part of the start sequence and is therefore sent to output. If a context check is performed at the very beginning of a file (or more generally of any body to be evaluated), the result is the same as matching with a newline character (this makes it possible for a cpp-mode file to start with a meta-macro call). .P Two special syntax rules were added in version 2.1. First, argument references (#\fIn\fP) are no longer evaluated when they are outside of macro calls and definitions. However, they are no longer allowed to appear (unless protected by quote characters) inside a call to a defined user macro; the current behavior (backwards compatible) is to remove them silently from the input if that happens. .P Second, if the end sequence (either for macros or comments) consists of a single newline character, and if delimitation rules lead to evaluation in a context where the final newline character is absent, GPP silently ignores the missing newline instead of producing an error. The main consequence is that meta-macro calls can now be nested in a simple way in standard, cpp and Prolog modes. .SH EVALUATION RULES .P Input is read sequentially and interpreted according to the rules of the current mode. All input text is first matched against the specified comment/string start sequences of the current mode (except those which are disabled by the 'i' modifier), unless the body being evaluated is the contents of a comment/string whose modifier enables macro evaluation. The most recently defined comment/string specifications are checked for first. Important note: comments may not appear between the name of a macro and its arguments (doing so results in undefined behavior). .P Anything that is not a comment/string is then matched against a possible meta-macro call, and if that fails too, against a possible user-macro call. All remaining text undergoes substitution of argument reference sequences by the relevant argument text (empty unless the body being evaluated is the definition of a user macro) and removal of the quote character if there is one. .P Note that meta-macro arguments are passed to the meta-macro prior to any evaluation (although the meta-macro may choose to evaluate them, see meta-macro descriptions below). In the case of the \fI#mode\fP meta-macro, GPP temporarily adds a comment/string specification to enable recognition of C strings ("...") and prevent any evaluation inside them, so no interference of the characters being put in the C string arguments to \fI#mode\fP with the current syntax is to be feared. .P On the other hand, the arguments to a user macro are systematically evaluated, and then passed as context parameters to the macro definition body, which gets evaluated with that environment. The only exception is when the macro definition is empty, in which case its arguments are not evaluated. Note that GPP temporarily switches back to the mode in which the macro was defined in order to evaluate it, so it is perfectly safe to change the operating mode between the time a macro is defined and the time when it is called. Conversely, if a user macro wishes to work with the current mode instead of the one that was used to define it it needs to start with a \fI#mode restore\fP call and end with a \fI#mode save\fP call. .P A user macro may be defined with named arguments (see \fI#define\fP description below). In that case, when the macro definition is being evaluated, each named parameter causes a temporary virtual user-macro definition to be created; such a macro may be called only without arguments and simply returns the text of the corresponding argument. .P Note that, since macros are evaluated when they are called rather than when they are defined, any attempt to call a recursive macro causes undefined behavior except in the very specific case when the macro uses \fI#undef\fP to erase itself after finitely many loop iterations. .P Finally, a special case occurs when a user macro whose definition does not involve any arguments (neither named arguments nor the argument reference sequence) is called in a mode where the short user-macro end sequence is empty (\fIe.g.\fP, cpp or TeX\ mode). In that case it is assumed to be an \fIalias macro\fP: its arguments are first evaluated in the current mode as usual, but instead of being passed to the macro definition as parameters (which would cause them to be discarded) they are actually appended to the macro definition, using the syntax rules of the mode in which the macro was defined, and the resulting text is evaluated again. It is therefore important to note that, in the case of a macro alias, the arguments actually get evaluated twice in two potentially different modes. .SH META-MACROS .P These macros are always predefined. Their actual calling sequence depends on the current mode; here we use cpp-like notation. .TP .BI "#define " "x y" This defines the user macro \fIx\fP as \fIy\fP. \fIy\fP can be any valid GPP input, and may for example refer to other macros. \fIx\fP must be an identifier (\fIi.e.\fP, a sequence of alphanumeric characters and '_'), unless named arguments are specified. If \fIx\fP is already defined, the previous definition is overwritten. If no second argument is given, \fIx\fP will be defined as a macro that outputs nothing. Neither \fIx\fP nor \fIy\fP are evaluated; the macro definition is only evaluated when it is called, not when it is declared. It is also possible to name the arguments in a macro definition: in that case, the argument \fIx\fP should be a user-macro call whose arguments are all identifiers. These identifiers become available as user-macros inside the macro definition; these virtual macros must be called without arguments, and evaluate to the corresponding macro parameter. .TP .BI "#defeval " "x y" This acts in a similar way to \fI#define\fP, but the second argument \fIy\fP is evaluated immediately. Since user macro definitions are also evaluated each time they are called, this means that the macro \fIy\fP will undergo \fItwo\fP successive evaluations. The usefulness of \fI#defeval\fP is considerable as it is the only way to evaluate something more than once, which may be needed to force evaluation of the arguments of a meta-macro that normally doesn't perform any evaluation. However since all argument references evaluated at define-time are understood as the arguments of the body in which the macro is being defined and not as the arguments of the macro itself, usually one has to use the quote character to prevent immediate evaluation of argument references. .TP .BI "#undef " "x" This removes any existing definition of the user macro \fIx\fP. .TP .BI "#ifdef " "x" This begins a conditional block. Everything that follows is evaluated only if the identifier \fIx\fP is defined, and until either a \fI#else\fP or a \fI#endif\fP statement is reached. Note, however, that the commented text is still scanned thoroughly, so its syntax must be valid. It is in particular legal to have the \fI#else\fP or \fI#endif\fP statement ending the conditional block appear only as the result of a user-macro expansion and not explicitly in the input. .TP .BI "#ifndef " "x" This begins a conditional block. Everything that follows is evaluated only if the identifier \fIx\fP is not defined. .TP .BI "#ifeq " "x y" This begins a conditional block. Everything that follows is evaluated only if the results of the evaluations of \fIx\fP and \fIy\fP are identical as character strings. Any leading or trailing whitespace is ignored for the comparison. Note that in cpp-mode any unquoted whitespace character is understood as the end of the first argument, so it is necessary to be careful. .TP .BI "#ifneq " "x y" This begins a conditional block. Everything that follows is evaluated only if the results of the evaluations of \fIx\fP and \fIy\fP are not identical (even up to leading or trailing whitespace). .TP .BI "#else" "" This toggles the logical value of the current conditional block. What follows is evaluated if and only if the preceding input was commented out. .TP .BI "#endif" "" This ends a conditional block started by a \fI#if...\fP meta-macro. .TP .BI "#include " "file" This causes GPP to open the specified file and evaluate its contents, inserting the resulting text in the current output. All defined user macros are still available in the included file, and reciprocally all macros defined in the included file will be available in everything that follows. The include file is looked for first in the current directory, and then, if not found, in one of the directories specified by the \fI\-I\fP command-line option (or \fI/usr/include\fP if no directory was specified). Note that, for compatibility reasons, it is possible to put the file name between "" or <>. The order in which the various directories are searched for include files is affected by the \fI\-nostdinc\fP, \fI\-nocurinc\fP and \fI\-curdirinclast\fP command-line options. Upon including a file, GPP immediately saves a copy of the current operating mode onto the mode stack, and restores the operating mode at the end of the included file. The included file may override this behavior by starting with a \fI#mode restore\fP call and ending with a \fI#mode push\fP call. Additionally, when the \fI\-m\fP command line option is specified, GPP will automatically switch to the cpp compatibility mode upon including a file whose name ends with either '.c' or '.h'. .TP .BI "#exec " "command" This causes GPP to execute the specified command line and include its standard output in the current output. Note that, for security reasons, this meta-macro is disabled unless the \fI\-x\fP command line flag was specified. If use of \fI#exec\fP is not allowed, a warning message is printed and the output is left blank. Note that the specified command line is evaluated before being executed, thus allowing the use of macros in the command-line. However, the output of the command is included verbatim and not evaluated. If you need the output to be evaluated, you must use \fI#defeval\fP (see above) to cause a double evaluation. .TP .BI "#eval " "expr" The \fI#eval\fP meta-macro attempts to evaluate \fIexpr\fP first by expanding macros (normal GPP evaluation) and then by performing arithmetic evaluation and/or wildcard matching. The syntax and operator precedence for arithmetic expressions are the same as in C; the only missing operators are <<, >>, ?:, and the assignment operators. POSIX-style wildcard matching ('globbing') is available only on POSIX implementations and can be invoked with the =~ operator. In brief, a '?' matches any single character, a '*' matches any string (including the empty string), and '[...]' matches any one of the characters enclosed in brackets. A '[...]' class is complemented when the first character in the brackets is '!'. The characters in a '[...]' class can also be specified as a range using the '\-' character -- \fIe.g.\fP, '[F\-N]' is equivalent to '[FGHIJKLMN]'. If unable to assign a numerical value to the result, the returned text is simply the result of macro expansion without any arithmetic evaluation. The only exceptions to this rule are the comparison operators ==, !=, <, >, <=, and >= which, if one of the sides does not evaluate to a number, perform string comparison instead (ignoring trailing and leading spaces). Additionally, the \fIlength(...)\fP arithmetic operator returns the length in characters of its evaluated argument. Inside arithmetic expressions, the \fIdefined(...)\fP special user macro is also available: it takes only one argument, which is not evaluated, and returns 1 if it is the name of a user macro and 0 otherwise. .TP .BI "#if " "expr" This meta-macro invokes the arithmetic/globbing evaluator in the same manner as \fI#eval\fP and compares the result of evaluation with the string "0" in order to begin a conditional block. In particular note that the logical value of \fIexpr\fP is always true when it cannot be evaluated to a number. .TP .BI "#elif " "expr" This meta-macro can be used to avoid nested \fI#if\fP conditions. \fI#if\fP ... \fI#elif\fP ... \fI#endif\fP is equivalent to \fI#if\fP ... \fI#else\fP \fI#if\fP ... \fI#endif\fP \fI#endif\fP. .TP .BI "#mode " "keyword ..." This meta-macro controls GPP's operating mode. See below for a list of \fI#mode\fP commands. .TP .BI "#line" "" This meta-macro evaluates to the line number of the current input file. .TP .BI "#file" "" This meta-macro evaluates to the filename of the current input file as it appears on the command line or in the argument to \fI#include\fP. If GPP is reading its input from stdin, then \fI#file\fP evaluates to `stdin'. .TP .BI "#date " "fmt" This meta-macro evaluates to the current date and time as formatted by the specified format string \fIfmt\fP. See the section \fIDATE AND TIME CONVERSION SPECIFIERS\fP below. .TP .BI "#error " "msg" This meta-macro causes an error message with the current filename and line number, and with the text \fImsg\fP, to be printed to the standard error device. Subsequent processing is then aborted. .TP .BI "#warning " "msg" This meta-macro causes a warning message with the current filename and line number, and with the text \fImsg\fP, to be printed to the standard error device. Subsequent processing is then resumed. .P The key to GPP's flexibility is the \fI#mode\fP meta-macro. Its first argument is always one of a list of available keywords (see below); its second argument is always a sequence of words separated by whitespace. Apart from possibly the first of them, each of these words is always a delimiter or syntax specifier, and should be provided as a C string delimited by double quotes ("\ "). The various special matching sequences listed in the section on syntax specification are available. Any \fI#mode\fP command is parsed in a mode where "..." is understood to be a C-style string, so it is safe to put any character inside these strings. Also note that the first argument of \fI#mode\fP (the keyword) is never evaluated, while the second argument is evaluated (except of course for the contents of C strings), so that the syntax specification may be obtained as the result of a macro evaluation. .P The available \fI#mode\fP commands are: .TP .BI "#mode save / #mode push" "" Push the current mode specification onto the mode stack. .TP .BI "#mode restore / #mode pop" "" Pop mode specification from the mode stack. .TP .BI "#mode standard " "name" Select one of the standard modes. The only argument must be one of: default (default mode); cpp, C (cpp mode); tex, TeX\ (tex mode); html, HTML (html mode); xhtml, XHTML (xhtml mode); prolog, Prolog (prolog mode). The mode name must be given directly, not as a C string. .TP .BI "#mode user " """s1"" ... ""s9""" Specify user macro syntax. The 9 arguments, all of them C strings, are the mode specification for user macros (see the \-U command-line option and the section on syntax specification). The meta-macro specification is not affected. .TP .BI "#mode meta " "{user | ""s1"" ... ""s7""}" Specify meta-macro syntax. Either the only argument is \fIuser\fP (not as a string), and the user-macro mode specifications are copied into the meta-macro mode specifications, or there must be seven string arguments, whose significance is the same as for the \-M command-line option (see section on syntax specification). .TP .BI "#mode quote " "[""c""]" With no argument or "" as argument, removes the quote character specification and disables the quoting functionality. With one string argument, the first character of the string is taken to be the new quote character. The quote character can be neither alphanumeric nor '_', nor can it be one of the special matching sequences. .TP .BI "#mode comment " "[xxx] ""start"" ""end"" [""c"" [""c""]]" Add a comment specification. Optionally a first argument consisting of three characters not enclosed in "\ " can be used to specify a comment/string modifier (see the section on syntax specification). The default modifier is \fIccc\fP. The first two string arguments are used as comment start and end sequences respectively. The third string argument is optional and can be used to specify a string-quote character. (If it is "", the functionality is disabled.) The fourth string argument is optional and can be used to specify a string delimitation warning character. (If it is "", the functionality is disabled.) .TP .BI "#mode string " "[xxx] ""start"" ""end"" [""c"" [""c""]]" Add a string specification. Identical to \fI#mode comment\fP except that the default modifier is \fIsss\fP. .TP .BI "#mode nocomment / #mode nostring " "[""start""]" With no argument, remove all comment/string specifications. With one string argument, delete the comment/string specification whose start sequence is the argument. .TP .BI "#mode preservelf " "{ on | off | 1 | 0 }" Equivalent to the \fI-n\fP command-line switch. If the argument is \fIon\fP or \fI1\fP, any newline or whitespace character terminating a macro call or a comment/string is left in the input stream for further processing. If the argument is \fIoff\fP or \fI0\fP this feature is disabled. .TP .BI "#mode charset " "{ id | op | par } ""string""" Specify the character sets to be used for matching the \\o, \\O and \\i special sequences. The first argument must be one of \fIid\fP (the set matched by \\i), \fIop\fP (the set matched by \\o) or \fIpar\fP (the set matched by \\O in addition to the one matched by \\o). \fI"string"\fP is a C string which lists all characters to put in the set. It may contain only the special matching sequences \\a, \\A, \\b, \\B, and \\# (the other sequences and the negated sequences are not allowed). When a '-' is found inbetween two non-special characters this adds all characters inbetween (e.g. "A-Z" corresponds to all uppercase characters). To have '-' in the matched set, either put it in first or last position or place it next to a \\x sequence. .SH DATE AND TIME CONVERSION SPECIFIERS Ordinary characters placed in the format string are copied to without conversion. Conversion specifiers are introduced by a `%' character, and are replaced as follows: .TP .BI "%a" "" The abbreviated weekday name according to the current locale. .TP .BI "%A" "" The full weekday name according to the current locale. .TP .BI "%b" "" The abbreviated month name according to the current locale. .TP .BI "%B" "" The full month name according to the current locale. .TP .BI "%c" "" The preferred date and time representation for the current locale. .TP .BI "%d" "" The day of the month as a decimal number (range 01 to 31). .TP .BI "%F" "" Equivalent to %Y-%m-%d (the ISO 8601 date format). .TP .BI "%H" "" The hour as a decimal number using a 24-hour clock (range 00 to 23). .TP .BI "%I" "" The hour as a decimal number using a 12-hour clock (range 01 to 12). .TP .BI "%j" "" The day of the year as a decimal number (range 001 to 366). .TP .BI "%m" "" The month as a decimal number (range 01 to 12). .TP .BI "%M" "" The minute as a decimal number (range 00 to 59). .TP .BI "%p" "" Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'. .TP .BI "%R" "" The time in 24-hour notation (%H:%M). .TP .BI "%S" "" The second as a decimal number (range 00 to 61). .TP .BI "%U" "" The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. .TP .BI "%w" "" The day of the week as a decimal, range 0 to 6, Sunday being 0. .TP .BI "%W" "" The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01. .TP .BI "%x" "" The preferred date representation for the current locale without the time. .TP .BI "%X" "" The preferred time representation for the current locale without the date. .TP .BI "%y" "" The year as a decimal number without a century (range 00 to 99). .TP .BI "%Y" "" The year as a decimal number including the century. .TP .BI "%Z" "" The time zone or name or abbreviation. .TP .BI "%%" "" A literal `%' character. .P Depending on the C compiler and library used to compile GPP, there may be more conversion specifiers available. Consult your compiler's documentation for the \fIstrftime()\fP function. Note, however, that any conversion specifiers not listed above may not be portable across installations of GPP. .SH EXAMPLES Here is a basic self-explanatory example in standard or cpp mode: #define FOO This is #define BAR a message. #define concat #1 #2 concat(FOO,BAR) #ifeq (concat(foo,bar)) (foo bar) This is output. #else This is not output. #endif Using argument naming, the \fIconcat\fP macro could alternatively be defined as #define concat(x,y) x y In TeX\ mode and using argument naming, the same example becomes: \\define{FOO}{This is} \\define{BAR}{a message.} \\define{\\concat{x}{y}}{\\x \\y} \\concat{\\FOO}{\\BAR} \\ifeq{\\concat{foo}{bar}}{foo bar} This is output. \\else This is not output. \\endif In HTML mode and without argument naming, one gets similarly: <#define FOO|This is> <#define BAR|a message.> <#define concat|#1 #2> <#concat <#FOO>|<#BAR>> <#ifeq <#concat foo|bar>|foo bar> This is output. <#else> This is not output. <#endif> The following example (in standard mode) illustrates the use of the quote character: #define FOO This is \\ a multiline definition. #define BLAH(x) My argument is x BLAH(urf) \\BLAH(urf) Note that the multiline definition is also valid in cpp and Prolog modes despite the absence of quote character, because '\\' followed by a newline is then interpreted as a comment and discarded. .P In cpp mode, C strings and comments are understood as such, as illustrated by the following example: #define BLAH foo BLAH "BLAH" /* BLAH */ 'It\\'s a /*string*/ !' The main difference between Prolog mode and cpp mode is the handling of strings and comments: in Prolog, a '...' string may not begin immediately after a digit, and a /*...*/ comment may not begin immediately after an operator character. Furthermore, comments are not removed from the output unless they occur in a #command. .P The differences between cpp mode and default mode are deeper: in default mode #commands may start anywhere, while in cpp mode they must be at the beginning of a line; the default mode has no knowledge of comments and strings, but has a quote character ('\\'), while cpp mode has extensive comment/string specifications but no quote character. Moreover, the arguments to meta-macros need to be correctly parenthesized in default mode, while no such checking is performed in cpp mode. .P This makes it easier to nest meta-macro calls in default mode than in cpp mode. For example, consider the following HTML mode input, which tests for the availability of the \fI#exec\fP command: <#ifeq <#exec echo blah>|blah > #exec allowed <#else> #exec not allowed <#endif> There is no cpp mode equivalent, while in default mode it can be easily translated as #ifeq (#exec echo blah ) (blah ) \\#exec allowed #else \\#exec not allowed #endif In order to nest meta-macro calls in cpp mode it is necessary to modify the mode description, either by changing the meta-macro call syntax, or more elegantly by defining a silent string and using the fact that the context at the beginning of an evaluated string is a newline character: #mode string QQQ "$" "$" #ifeq $#exec echo blah $ $blah $ \\#exec allowed #else \\#exec not allowed #endif Note, however, that comments/strings cannot be nested ("..." inside $...$ would go undetected), so one needs to be careful about what to include inside such a silent evaluated string. In this example, the loose meta-macro nesting introduced in version 2.1 makes it possible to use the following simpler version: #ifeq blah #exec echo -n blah \\#exec allowed #else \\#exec not allowed #endif Remember that macros without arguments are actually understood to be aliases when they are called with arguments, as illustrated by the following example (default or cpp mode): #define DUP(x) x x #define FOO and I said: DUP FOO(blah) The usefulness of the \fI#defeval\fP meta-macro is shown by the following example in HTML mode: <#define APPLY|<#defeval TEMP|<\\##1 \\#1>><#TEMP #2>> <#define <#foo x>|<#x> and <#x>> <#APPLY foo|BLAH> The reason why \fI#defeval\fP is needed is that, since everything is evaluated in a single pass, the input that will result in the desired macro call needs to be generated by a first evaluation of the arguments passed to APPLY before being evaluated a second time. .P To translate this example in default mode, one needs to resort to parenthesizing in order to nest the #defeval call inside the definition of APPLY, but need to do so without outputting the parentheses. The easiest solution is #define BALANCE(x) x #define APPLY(f,v) BALANCE(#defeval TEMP f TEMP(v)) #define foo(x) x and x APPLY(\\foo,BLAH) As explained above the simplest version in cpp mode relies on defining a silent evaluated string to play the role of the BALANCE macro. .P The following example (default or cpp mode) demonstrates arithmetic evaluation: #define x 4 The answer is: #eval x*x + 2*(16-x) + 1998%x #if defined(x)&&!(3*x+5>17) This should be output. #endif To finish, here are some examples involving mode switching. The following example is self-explanatory (starting in default mode): #mode push #define f(x) x x #mode standard tex \\f{blah} \\mode{string}{"$" "$"} \\mode{comment}{"/*" "*/"} $\\f{urf}$ /* blah */ \\define{FOO}{bar/* and some more */} \\mode{pop} f($FOO$) A good example where a user-defined mode becomes useful is the GPP source of this document (available with GPP's source code distribution). .P Another interesting application is selectively forcing evaluation of macros in C strings when in cpp mode. For example, consider the following input: #define blah(x) "and he said: x" blah(foo) Obviously one would want the parameter \fIx\fP to be expanded inside the string. There are several ways around this problem: #mode push #mode nostring "\\"" #define blah(x) "and he said: x" #mode pop #mode quote "`" #define blah(x) `"and he said: x`" #mode string QQQ "$$" "$$" #define blah(x) $$"and he said: x"$$ The first method is very natural, but has the inconvenience of being lengthy and neutralizing string semantics, so that having an unevaluated instance of 'x' in the string, or an occurrence of '/*', would be impossible without resorting to further contortions. .P The second method is slightly more efficient because the local presence of a quote character makes it easier to control what is evaluated and what isn't, but has the drawback that it is sometimes impossible to find a reasonable quote character without having to either significantly alter the source file or enclose it inside a \fI#mode push/pop\fP construct. For example, any occurrence of '/*' in the string would have to be quoted. .P The last method demonstrates the efficiency of evaluated strings in the context of selective evaluation: since comments/strings cannot be nested, any occurrence of '"' or '/*' inside the '$$' gets output as plain text, as expected inside a string, and only macro evaluation is enabled. Also note that there is much more freedom in the choice of a string delimiter than in the choice of a quote character. .P Starting with version 2.1, meta-macro calls can be nested more efficiently in default, cpp and Prolog modes. This makes it easy to make a user version of a meta-macro, or to increment a counter: #define myeval #eval #1 #define x 1 #defeval x #eval x+1 .SH ADVANCED EXAMPLES .P Here are some examples of advanced constructions using GPP. They tend to be pretty awkward and should be considered as evidence of GPP's limitations. .P The first example is a recursive macro. The main problem is that (since GPP evaluates everything) a recursive macro must be very careful about the way in which recursion is terminated in order to avoid undefined behavior (most of the time GPP will simply crash). In particular, relying on a \fI#if/#else/#endif\fP construct to end recursion is not possible and results in an infinite loop, because GPP scans user macro calls even in the unevaluated branch of the conditional block. A safe way to proceed is for example as follows (we give the example in TeX\ mode): \\define{countdown}{ \\if{#1} #1... \\define{loop}{\\countdown} \\else Done. \\define{loop}{} \\endif \\loop{\\eval{#1-1}} } \\countdown{10} .P Another example, in cpp mode: #mode string QQQ "$" "$" #define triangle(x,y) y \\ $#if length(y) LAMBDA(z,z+z) LAMBDA(z,z+z,2) => 2+2 #define f LAMBDA(y,y*y) f => LAMBDA(y,y*y) APPLY(f,blah) => blah*blah APPLY(LAMBDA(t,t t),(t t)) => (t t) (t t) LAMBDA(x,APPLY(f,(x+x)),urf) => (urf+urf)*(urf+urf) APPLY(APPLY(LAMBDA(x,LAMBDA(y,x*y)),foo),bar) => foo*bar #define test LAMBDA(y,`#ifeq y urf y is urf#else y is not urf#endif `) APPLY(test,urf) => urf is urf APPLY(test,foo) => foo is not urf .SH SEE ALSO strftime(3), glob(7), m4(1V), cpp(1) .P GPP home page: http://www.nothingisreal.com/gpp/ .SH AUTHOR GPP was written by Denis Auroux . Since version 2.12 it has been maintained by Tristan Miller . .SH COPYRIGHT Copyright (C)\ 1996-2001 Denis Auroux. .P Copyright (C)\ 2003, 2004 Tristan Miller. .P Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. .P Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. gpp-2.24/doc/gpp.pp0000644000076400001440000016474510123364704007625 <#mode preservelf|off><#mode comment|"%%%" "\n">%%% %%%% %%%% $Id: gpp.pp,v 1.6 2004/09/19 20:19:16 psy Exp $ %%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% GPP documentation source file %%%% %%%% (C) 2001 Denis Auroux %%%% %%%% (C) 2003, 2004 Tristan Miller %%%% %%%% %%%% %%%% To get the man page, run: %%%% %%%% gpp -H -Dman gpp.pp -o gpp.1 %%%% %%%% To get the html page, run: %%%% %%%% gpp -H -Dhtml gpp.pp -o gpp.html %%%% %%%% To get a latex version, run: %%%% %%%% gpp -H -Dlatex gpp.pp -o gpp.tex %%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% %%%% <#mode user|"$" "$" "{" "}{" "}$" "{" "}" "@@@" "~">%%% <#mode meta|"$" "$\w\n" "{" "}{" "}$\w\n" "{" "}">%%% %%%% %%%%%%%%%%% HTML page macro definitions %%%%%%%%%%% $ifdef{html}$ $define{P}{

}$ $define{p}{

}$ $define{BR}{
}$ $define{I}{@@@1}$ $define{S}{


@@@1

}$ $define{B}{@@@1}$ $define{l}{<}$ $define{g}{>}$ $define{d}{-}$ $define{b}{\}$ $define{pre}{
}$
$define{nopre}{
}$ $define{list}{
    @@@1
}$ $define{li}{

  • }$ $define{BI}{@@@1@@@2
    }$ $define{bi}{@@@1:}$ $define{s}{"@@@1"}$ $define{pc}{%}$ $define{tilde}{~~}$ $define{and}{&}$ $define{dollar}{~$}$ $define{bra}{~{}$ $define{ket}{~}}$ $define{dz}{#}$ $define{und}{_}$ $define{copy}{©}$ $define{nbsp}{ }$ $define{TeX}{TeX}$ $define{ldots}{…}$ $define{mdash}{—}$ $define{ndash}{–}$ $define{exp}{^}$ $define{pipe}{|}$ $else$ %%%%%%%%%%% man page macro definitions %%%%%%%%%%%% $ifdef{man}$ $define{P}{ .P}$ $define{p}{}$ $define{BR}{ .P}$ $define{I}{\fI@@@1\fP}$ $define{S}{ .SH @@@1}$ $define{B}{.B @@@1}$ $define{l}{<}$ $define{g}{>}$ $define{d}{\-}$ $define{b}{\\}$ $define{pre}{ }$ $define{nopre}{}$ $define{list}{@@@1}$ $define{li}{.TP}$ $define{BI}{.BI "@@@1" "@@@2"}$ $define{bi}{.BI "@@@1" ""}$ $define{s}{""@@@1""}$ $define{pc}{%}$ $define{tilde}{~~}$ $define{and}{&}$ $define{dollar}{~$}$ $define{bra}{~{}$ $define{ket}{~}}$ $define{dz}{#}$ $define{und}{_}$ $define{copy}{(C)}$ $define{nbsp}{\ }$ $define{TeX}{TeX}$ $define{ldots}{...}$ $define{mdash}{ -- }$ $define{ndash}{-}$ $define{exp}{^}$ $define{pipe}{|}$ $else$ %%%%%%%%%%% latex page macro definitions %%%%%%%%%%% $ifdef{latex}$ $define{P}{ }$ $define{p}{ }$ $define{BR}{ }$ $define{I}{$isverb{@@@1}{{\it @@@1}}$}$ $define{S}{\subsection{@@@1}}$ $define{B}{{\bf @@@1}}$ $define{l}{$isverb{<}{$<$}$}$ $define{g}{$isverb{>}{$>$}$}$ $define{d}{-}$ $define{b}{$isverb{\}{$\backslash$}$}$ $define{pre}{$define{inverb}$ \begin{verbatim}}$ $define{nopre}{\end{verbatim}$undef{inverb}$ }$ $define{isverb}{$ifdef{inverb}$ @@@1$else$ @@@2$endif$ }$ $define{list}{\begin{itemize}@@@1\end{itemize}}$ $define{li}{\item}$ $define{BI}{{\bf @@@1} @@@2\\}$ $define{bi}{{\bf @@@1}: }$ $define{s}{"@@@1"}$ $define{pc}{$isverb{%}{\%}$}$ $define{tilde}{$isverb{~~}{$\sim$}$}$ $define{and}{$isverb{&}{\&}$}$ $define{dollar}{$isverb{~$}{\~$}$}$ $define{bra}{$isverb{~{}{\~{}$}$ $define{ket}{$isverb{~}}{\~}}$}$ $define{dz}{$isverb{#}{\#}$}$ $define{TeX}{\TeX}$ $define{und}{$isverb{_}{\_}$}$ $define{copy}{\copyright}$ $define{nbsp}{~~}$ $define{ldots}{\ldots}$ $define{mdash}{---}$ $define{ndash}{--}$ $define{exp}{$isverb{^}{\^{}}$}$ $define{pipe}{$isverb{|}{$|$}$}$ $else$ This is the gpp help file. To get the man page, run: gpp -H -Dman gpp.pp -o gpp.1 To get the HTML page, run: gpp -H -Dhtml gpp.pp -o gpp.html To get a LaTeX version, run: gpp -H -Dlatex gpp.pp -o gpp.tex $mode{comment}{"!!!" "!!!"}$ !!! $endif$ $endif$ $endif$ %%%%%%%%%%%%%%%%% some headers %%%%%%%%%%%%%%%%%%% $define{version}{2.24}$ $define{SYNTAX}{ $pre$ gpp [$d$$bra$o$pipe$O$ket$ $I{outfile}$] [$d$I$I{/include/path}$] [$d$D$I{name=val}$ ...] [$d$z$pipe$+z] [$d$x] [$d$m] [$d$C$pipe$$d$T$pipe$$d$H$pipe$$d$X$pipe$$d$P$pipe$$d$U ... [$d$M ...]] [$d$n$pipe$+n] [+c$I{$l$n$g$}$ $I{str1}$ $I{str2}$] [+s$I{$l$n$g$}$ $I{str1}$ $I{str2}$ $I{c}$] [$d$c $I{str1}$] [$d$$d$nostdinc] [$d$$d$nocurinc] [$d$$d$curdirinclast] [$d$$d$warninglevel $I{n}$] [$d$$d$includemarker $I{str}$] [$d$$d$include $I{file}$] [$I{infile}$] gpp $d$$d$help gpp $d$$d$version$nopre$ }$ $ifdef{html}$ GPP $version$ $mdash$ Generic Preprocessor

    GPP $version$ — Generic Preprocessor

    N.B. $mdash$ The latest version of GPP and this manual are available from the GPP home page. $else$ $ifdef{man}$ .TH GPP 1 \" -*- nroff -*- .SH NAME GPP \- Generic Preprocessor .SH SYNOPSIS $SYNTAX$%%% $else$ \documentclass[12pt]{article} \title{GPP$nbsp$$version$ $mdash$ Generic Preprocessor} \author{Denis Auroux, Tristan Miller} \date{} \renewcommand{\thesubsection}{\arabic{subsection}} \begin{document} \maketitle $endif$ $endif$ %%%%%%%%%%%%%% description section %%%%%%%%%%%%%%%%%%%% $S{DESCRIPTION}$ $P$ GPP is a general-purpose preprocessor with customizable syntax, suitable for a wide range of preprocessing tasks. Its independence from any programming language makes it much more versatile than cpp, while its syntax is lighter and more flexible than that of m4. $P$ GPP is targeted at all common preprocessing tasks where cpp is not suitable and where no very sophisticated features are needed. In order to be able to process equally efficiently text files or source code in a variety of languages, the syntax used by GPP is fully customizable. The handling of comments and strings is especially advanced. $P$ Initially, GPP only understands a minimal set of built-in macros, called $I{meta-macros}$. These meta-macros allow the definition of $I{user macros}$ as well as some basic operations forming the core of the preprocessing system, including conditional tests, arithmetic evaluation, wildcard matching (globbing), and syntax specification. All user macro definitions are global$mdash$$I{i.e.}$, they remain valid until explicitly removed; meta-macros cannot be redefined. With each user macro definition GPP keeps track of the corresponding syntax specification so that a macro can be safely invoked regardless of any subsequent change in operating mode. $P$ In addition to macros, GPP understands comments and strings, whose syntax and behavior can be widely customized to fit any particular purpose. Internally comments and strings are the same construction, so everything that applies to comments applies to strings as well. $ifndef{man}$ $S{SYNTAX}$ $SYNTAX$ $endif$ %%%%%%%%%%%%%%%% command-line options %%%%%%%%%%%%%%%%%%%% $S{OPTIONS}$ $P$ GPP recognizes the following command-line switches and options. Note that the $d$nostdinc, $d$nocurinc, $d$curdirinclast, $d$warninglevel, and $d$includemarker options from version 2.1 and earlier are deprecated and should not be used. Use the "long option" variants instead ($d$$d$nostdinc, $I{etc.}$). $list{$li$ $BI{$d$h $d$$d$help}$ Print a short help message. $li$ $BI{$d$$d$version}$ Print version information. $li$ $BI{$d$o }{outfile}$ Specify a file to which all output should be sent (by default, everything is sent to standard output). $li$ $BI{$d$O }{outfile}$ Specify a file to which all output should be sent; output is simultanously sent to stdout. $li$ $BI{$d$I}{/include/path}$ Specify a path where the $I{$dz$include}$ meta-macro will look for include files if they are not present in the current directory. The default is /usr/include if no $d$I option is specified. Multiple $d$I options may be specified to look in several directories. $li$ $BI{$d$D}{name=val}$ Define the user macro $I{name}$ as equal to $I{val}$. This is strictly equivalent to using the $I{$dz$define}$ meta-macro, but makes it possible to define macros from the command-line. If $I{val}$ makes references to arguments or other macros, it should conform to the syntax of the mode specified on the command-line. Starting with version 2.1, macro argument naming is allowed on the command-line. The syntax is as follows: $d$D$I{macro}$($I{arg1}$,$ldots$)=$I{definition}$. The arguments are specified in C-style syntax, without any whitespace, but the definition should still conform to the syntax of the mode specified on the command-line. $li$ $BI{+z}$ Set text mode to Unix mode (LF terminator). Any CR character in the input is systematically discarded. This is the default under Unix systems. $li$ $BI{$d$z}$ Set text mode to DOS mode (CR$ndash$LF terminator). In this mode all CR characters are removed from the input, and all output LF characters are converted to CR$ndash$LF. This is the default if GPP is compiled with the WIN$und$NT option. $li$ $BI{$d$x}$ Enable the use of the $I{$dz$exec}$ meta-macro. Since $I{$dz$exec}$ includes the output of an arbitrary shell command line, it may cause a potential security threat, and is thus disabled unless this option is specified. $li$ $BI{$d$m}$ Enable automatic mode switching to the cpp compatibility mode if the name of an included file ends in `.h' or `.c'. This makes it possible to include C header files with only minor modifications. $li$ $BI{$d$n}$ Prevent newline or whitespace characters from being removed from the input when they occur as the end of a macro call or of a comment. By default, when a newline or whitespace character forms the end of a macro or a comment it is parsed as part of the macro call or comment and therefore removed from output. Use the $d$n option to keep the last character in the input stream if it was whitespace or a newline. This is activated in cpp and Prolog modes. $li$ $BI{+n}$ The opposite of $d$n. This is the default in all modes except cpp and Prolog. Note that +n must be placed $I{after}$ $d$C or $d$P in order to have any effect. $li$ $BI{$d$U }{arg1 $ldots$ arg9}$ User-defined mode. The nine following command-line arguments are taken to be respectively the macro start sequence, the macro end sequence for a call without arguments, the argument start sequence, the argument separator, the argument end sequence, the list of characters to stack for argument balancing, the list of characters to unstack, the string to be used for referring to an argument by number, and finally the quote character (if there is none an empty string should be provided). These settings apply both to user macros and to meta-macros, unless the $d$M option is used to define other settings for meta-macros. See the section on syntax specification for more details. $li$ $BI{$d$M }{arg1 $ldots$ arg7}$ User-defined mode specifications for meta-macros. This option can only be used together with $d$M. The seven following command-line arguments are taken to be respectively the macro start sequence, the macro end sequence for a call without arguments, the argument start sequence, the argument separator, the argument end sequence, the list of characters to stack for argument balancing, and the list of characters to unstack. See below for more details. $li$ $BI{(default mode)}$ The default mode is a vaguely cpp-like mode, but it does not handle comments, and presents various incompatibilities with cpp. Typical meta-macros and user macros look like this: $pre$ $dz$define x y macro(arg,...) $nopre$ This mode is equivalent to $pre$ -U "" "" "(" "," ")" "(" ")" "$dz$" "$b$$b$" -M "$dz$" "$b$n" " " " " "$b$n" "(" ")" $nopre$ $li$ $BI{$d$C}$ cpp compatibility mode. This is the mode where GPP's behavior is the closest to that of cpp. Unlike in the default mode, meta-macro expansion occurs only at the beginning of lines, and C comments and strings are understood. This mode is equivalent to $pre$ -n -U "" "" "(" "," ")" "(" ")" "$dz$" "" -M "$b$n$dz$$b$w" "$b$n" " " " " "$b$n" "" "" +c "/*" "*/" +c "//" "$b$n" +c "$b$$b$$b$n" "" +s "$b$"" "$b$"" "$b$$b$" +s "'" "'" "$b$$b$" $nopre$ $li$ $BI{$d$T}$ $TeX$-like mode. In this mode, typical meta-macros and user macros look like this: $pre$ $b$define$bra$x$ket$$bra$y$ket$ $b$macro$bra$arg$ket$$bra$...$ket$ $nopre$ No comments are understood. This mode is equivalent to $pre$ -U "$b$$b$" "" "$bra$" "$ket$$bra$" "$ket$" "$bra$" "$ket$" "$dz$" "@" $nopre$ $li$ $BI{$d$H}$ HTML-like mode. In this mode, typical meta-macros and user macros look like this: $pre$ $l$$dz$define x$pipe$y$g$ $l$$dz$macro arg$pipe$...$g$ $nopre$ No comments are understood. This mode is equivalent to $pre$ -U "$l$$dz$" "$g$" "$b$B" "$pipe$" "$g$" "$l$" "$g$" "$dz$" "$b$$b$" $nopre$ $li$ $BI{$d$X}$ XHTML-like mode. In this mode, typical meta-macros and user macros look like this: $pre$ $l$$dz$define x$pipe$y/$g$ $l$$dz$macro arg$pipe$.../$g$ $nopre$ No comments are understood. This mode is equivalent to $pre$ -U "$l$$dz$" "/$g$" "$b$B" "$pipe$" "/$g$" "$l$" "$g$" "$dz$" "$b$$b$" $nopre$ $li$ $BI{$d$P}$ Prolog-compatible cpp-like mode. This mode differs from the cpp compatibility mode by its handling of comments, and is equivalent to $pre$ -n -U "" "" "(" "," ")" "(" ")" "$dz$" "" -M "$b$n$dz$$b$w" "$b$n" " " " " "$b$n" "" "" +ccss "$b$!o/*" "*/" +ccss "$pc$" "$b$n" +ccii "$b$$b$$b$n" "" +s "$b$"" "$b$"" "" +s "$b$!$dz$'" "'" "" $nopre$ $li$ $BI{+c}{$l$n$g$ str1 str2}$ Specify comments. Any unquoted occurrence of $I{str1}$ will be interpreted as the beginning of a comment. All input up to the first following occurrence of $I{str2}$ will be discarded. This option may be used multiple times to specify different types of comment delimiters. The optional parameter $I{$l$n$g$}$ can be specified to alter the behavior of the comment and, $I{e.g.}$, turn it into a string or make it ignored under certain circumstances, see below. $li$ $BI{$d$c }{str1}$ Un-specify comments or strings. The comment/string specification whose start sequence is $I{str1}$ is removed. This is useful to alter the built-in comment specifications of a standard mode$mdash$$I{e.g.}$, the cpp compatibility mode. $li$ $BI{+s}{$l$n$g$ str1 str2 c}$ Specify strings. Any unquoted occurrence of $I{str1}$ will be interpreted as the beginning of a string. All input up to the first following occurrence of $I{str2}$ will be output as is without any evaluation. The delimiters themselves are output. If $I{c}$ is non-empty, its first character is used as a $I{string-quote character}$$mdash$$I{i.e.}$, a character whose presence immediately before an occurrence of $I{str2}$ prevents it from terminating the string. The optional parameter $I{$l$n$g$}$ can be specified to alter the behavior of the string and, $I{e.g.}$, turn it into a comment, enable macro evaluation inside the string, or make the string specification ignored under certain circumstances. See below. $li$ $BI{$d$s }{str1}$ Un-specify comments or strings. Identical to $d$c. $li$ $BI{$d$$d$include }{file}$ Process $I{file}$ before $I{infile}$ $li$ $BI{$d$$d$nostdinc}$ Do not look for include files in the standard directory /usr/include. $li$ $BI{$d$$d$nocurinc}$ Do not look for include files in the current directory. $li$ $BI{$d$$d$curdirinclast}$ Look for include files in the current directory $I{after}$ the directories specified by $I{$d$I}$ rather than before them. $li$ $BI{$d$$d$warninglevel }{n}$ Set warning level to $I{n}$ (0, 1 or 2). Default is 2 (most verbose). $li$ $BI{$d$$d$includemarker }{str}$ keep track of $I{$dz$include}$ directives by inserting a marker in the output stream. The format of the marker is determined by $I{str}$, which must contain three occurrences of the character $I{$pc$}$ (or equivalently $I{?}$). The first occurrence is replaced with the line number, the second with the file name, and the third with 1, 2 or blank. When this option is specified in default, cpp or Prolog mode, GPP does its best to ensure that line numbers are the same in the output as in the input by inserting blank lines in the place of definitions or comments. $li$ $BI{infile}$ Specify an input file from which GPP reads its input. If no input file is specified, input is read from standard input. }$ %%%%%%%%%%%%%%%%% syntax specification %%%%%%%%%%%%%%%%%%% $S{SYNTAX SPECIFICATION}$ $P$ The syntax of a macro call is as follows: it must start with a sequence of characters matching the $I{macro start sequence}$ as specified in the current mode, followed immediately by the name of the macro, which must be a valid $I{identifier}$$mdash$$I{i.e.}$, a sequence of letters, digits, or underscores ("$und$"). The macro name must be followed by a $I{short macro end sequence}$ if the macro has no arguments, or by a sequence of arguments initiated by an $I{argument start sequence}$. The various arguments are then separated by an $I{argument separator}$, and the macro ends with a $I{long macro end sequence}$. $P$ In all cases, the parameters of the current context$mdash$$I{i.e.}$, the arguments passed to the body being evaluated$mdash$can be referred to by using an $I{argument reference sequence}$ followed by a digit between 1 and 9. Alternatively, macro parameters may be named (see below). Furthermore, to avoid interference between the GPP syntax and the contents of the input file, a $I{quote character}$ is provided. The quote character can be used to prevent the interpretation of a macro call, comment, or string as anything but plain text. The quote character "protects" the following character, and always gets removed during evaluation. Two consecutive quote characters evaluate as a single quote character. $P$ Finally, to facilitate proper argument delimitation, certain characters can be "stacked" when they occur in a macro argument, so that the argument separator or macro end sequence are not parsed if the argument body is not balanced. This allows nesting macro calls without using quotes. If an improperly balanced argument is needed, quote characters should be added in front of some stacked characters to make it balanced. $P$ The macro construction sequences described above can be different for meta-macros and for user macros: this is the case in cpp mode, for example. Note that, since meta-macros can only have up to two arguments, the delimitation rules for the second argument are somewhat sloppier, and unquoted argument separator sequences are allowed in the second argument of a meta-macro. $P$ Unless one of the standard operating modes is selected, the above syntax sequences can be specified either on the command-line, using the $d$M and $d$U options respectively for meta-macros and user macros, or inside an input file via the $I{$dz$mode meta}$ and $I{$dz$mode user}$ meta-macro calls. In both cases the mode description consists of nine parameters for user macro specifications, namely the macro start sequence, the short macro end sequence, the argument start sequence, the argument separator, the long macro end sequence, the string listing characters to stack, the string listing characters to unstack, the argument reference sequence, and finally the quote character. As explained below, these sequences should be supplied using the syntax of C strings; they must start with a non-alphanumeric character, and in the first five strings special matching sequences can be used (see below). If the argument corresponding to the quote character is the empty string, that argument's functionality is disabled. For meta-macro specifications there are only seven parameters, as the argument reference sequence and quote character are shared with the user macro syntax. $P$ The structure of a comment/string is as follows: it must start with a sequence of characters matching the given $I{comment/string start sequence}$, and always ends at the first occurrence of the $I{comment/string end sequence}$, unless it is preceded by an odd number of occurrences of the $I{string-quote character}$ (if such a character has been specified). In certain cases comment/strings can be specified to enable macro evaluation inside the comment/string; in that case, if a quote character has been defined for macros it can be used as well to prevent the comment/string from ending, with the difference that the macro quote character is always removed from output whereas the string-quote character is always output. Also note that under certain circumstances a comment/string specification can be $I{disabled}$, in which case the comment/string start sequence is simply ignored. Finally, it is possible to specify a $I{string warning character}$ whose presence inside a comment/string will cause GPP to output a warning (this is useful to locate unterminated strings in cpp mode). Note that input files are not allowed to contain unterminated comments/strings. $P$ A comment/string specification can be declared from within the input file using the $I{$dz$mode comment}$ meta-macro call (or equivalently $I{$dz$mode string}$), in which case the number of C strings to be given as arguments to describe the comment/string can be anywhere between two and four: the first two arguments (mandatory) are the start sequence and the end sequence, and can make use of the special matching sequences (see below). They may not start with alphanumeric characters. The first character of the third argument, if there is one, is used as the string-quote character (use an empty string to disable the functionality), and the first character of the fourth argument, if there is one, is used as the string-warning character. A specification may also be given from the command-line, in which case there must be two arguments if using the +c option and three if using the +s option. $P$ The behavior of a comment/string is specified by a three-character modifier string, which may be passed as an optional argument either to the +c/+s command-line options or to the $I{$dz$mode comment}$/$I{$dz$mode string}$ meta-macros. If no modifier string is specified, the default value is "ccc" for comments and "sss" for strings. The first character corresponds to the behavior inside meta-macro calls (including user-macro definitions since these come inside a $I{$dz$define}$ meta-macro call), the second character corresponds to the behavior inside user-macro parameters, and the third character corresponds to the behavior outside of any macro call. Each of these characters can take the following values: $list{ $li$ $bi{i}$ disable the comment/string specification. $li$ $bi{c}$ comment (neither evaluated nor output). $li$ $bi{s}$ string (the string and its delimiter sequences are output as-is). $li$ $bi{q}$ quoted string (the string is output as-is, without the delimiter sequences). $li$ $bi{C}$ evaluated comment (macros are evaluated, but output is discarded). $li$ $bi{S}$ evaluated string (macros are evaluated, delimiters are output). $li$ $bi{Q}$ evaluated quoted string (macros are evaluated, delimiters are not output).}$ $P$ Important note: any occurrence of a comment/string start sequence inside another comment/string is always ignored, even if macro evaluation is enabled. In other words, comments/strings cannot be nested. In particular, the `Q' modifier can be a convenient way of defining a syntax for temporarily disabling all comment and string specifications. $P$ Syntax specification strings should always be provided as C strings, whether they are given as arguments to a $I{$dz$mode}$ meta-macro call or on the command-line of a Unix shell. If command-line arguments are given via another method than a standard Unix shell, then the shell behavior must be emulated$mdash$$I{i.e.}$, the surrounding "" quotes should be removed, all occurrences of `$b$$b$' should be replaced by a single backslash, and similarly `$b$"' should be replaced by `"'. Sequences like `$b$n' are recognized by GPP and should be left as is. $P$ Special sequences matching certain subsets of the character set can be used. They are of the form `$b$$I{x}$', where $I{x}$ is one of: $list{ $li$ $bi{b}$ matches any sequence of one or more spaces or tab characters (`$b$b' is identical to `$nbsp$'). $li$ $bi{w}$ matches any sequence of zero or more spaces or tab characters. $li$ $bi{B}$ matches any sequence of one or more spaces, tabs or newline characters. $li$ $bi{W}$ matches any sequence of zero or more spaces, tabs or newline characters. $li$ $bi{a}$ an alphabetic character (`a' to `z' and `A' to `Z'). $li$ $bi{A}$ an alphabetic character, or a space, tab or newline. $li$ $bi{$dz$}$ a digit (`0' to `9'). $li$ $bi{i}$ an identifier character. The set of matched characters is customizable using the $I{$dz$mode charset id}$ command. The default setting matches alphanumeric characters and underscores (`a' to `z', `A' to `Z', `0' to `9' and `$und$'). $li$ $bi{t}$ a tab character. $li$ $bi{n}$ a newline character. $li$ $bi{o}$ an operator character. The set of matched characters is customizable using the $I{$dz$mode charset op}$ command. The default setting matches all characters in "+-*/$b$$exp$$l$$g$=`$tilde$:.?@$dz$$and$!$pc$$pipe$", except in Prolog mode where `!', `$pc$' and `$pipe$' are not matched. $li$ $bi{O}$ an operator character or a parenthesis character. The set of additional matched characters in comparison with `$b$o' is customizable using the $I{$dz$mode charset par}$ command. The default setting is to have the characters in "()[]$bra$$ket$" as parentheses.}$ $P$ Moreover, all of these matching subsets except `$b$w' and `$b$W' can be negated by inserting a `!'$mdash$$I{i.e.}$, by writing `$b$!$I{x}$' instead of `$b$$I{x}$'. $P$ Note an important distinctive feature of $I{start sequences}$: when the first character of a macro or comment/string start sequence is '$nbsp$' or one of the above special sequences, it is not taken to be part of the sequence itself but is used instead as a context check: for example a start sequence beginning with '$b$n' matches only at the beginning of a line, but the matching newline character is not taken to be part of the sequence. Similarly a start sequence beginning with '$nbsp$' matches only if some whitespace is present, but the matching whitespace is not considered to be part of the start sequence and is therefore sent to output. If a context check is performed at the very beginning of a file (or more generally of any body to be evaluated), the result is the same as matching with a newline character (this makes it possible for a cpp-mode file to start with a meta-macro call). $P$ Two special syntax rules were added in version 2.1. First, argument references ($dz$$I{n}$) are no longer evaluated when they are outside of macro calls and definitions. However, they are no longer allowed to appear (unless protected by quote characters) inside a call to a defined user macro; the current behavior (backwards compatible) is to remove them silently from the input if that happens. $P$ Second, if the end sequence (either for macros or comments) consists of a single newline character, and if delimitation rules lead to evaluation in a context where the final newline character is absent, GPP silently ignores the missing newline instead of producing an error. The main consequence is that meta-macro calls can now be nested in a simple way in standard, cpp and Prolog modes. %%%%%%%%%%%%%%%%%% evaluation rules %%%%%%%%%%%%%%%%%%%% $S{EVALUATION RULES}$ $P$ Input is read sequentially and interpreted according to the rules of the current mode. All input text is first matched against the specified comment/string start sequences of the current mode (except those which are disabled by the 'i' modifier), unless the body being evaluated is the contents of a comment/string whose modifier enables macro evaluation. The most recently defined comment/string specifications are checked for first. Important note: comments may not appear between the name of a macro and its arguments (doing so results in undefined behavior). $P$ Anything that is not a comment/string is then matched against a possible meta-macro call, and if that fails too, against a possible user-macro call. All remaining text undergoes substitution of argument reference sequences by the relevant argument text (empty unless the body being evaluated is the definition of a user macro) and removal of the quote character if there is one. $P$ Note that meta-macro arguments are passed to the meta-macro prior to any evaluation (although the meta-macro may choose to evaluate them, see meta-macro descriptions below). In the case of the $I{$dz$mode}$ meta-macro, GPP temporarily adds a comment/string specification to enable recognition of C strings ("$ldots$") and prevent any evaluation inside them, so no interference of the characters being put in the C string arguments to $I{$dz$mode}$ with the current syntax is to be feared. $P$ On the other hand, the arguments to a user macro are systematically evaluated, and then passed as context parameters to the macro definition body, which gets evaluated with that environment. The only exception is when the macro definition is empty, in which case its arguments are not evaluated. Note that GPP temporarily switches back to the mode in which the macro was defined in order to evaluate it, so it is perfectly safe to change the operating mode between the time a macro is defined and the time when it is called. Conversely, if a user macro wishes to work with the current mode instead of the one that was used to define it it needs to start with a $I{$dz$mode restore}$ call and end with a $I{$dz$mode save}$ call. $P$ A user macro may be defined with named arguments (see $I{$dz$define}$ description below). In that case, when the macro definition is being evaluated, each named parameter causes a temporary virtual user-macro definition to be created; such a macro may be called only without arguments and simply returns the text of the corresponding argument. $P$ Note that, since macros are evaluated when they are called rather than when they are defined, any attempt to call a recursive macro causes undefined behavior except in the very specific case when the macro uses $I{$dz$undef}$ to erase itself after finitely many loop iterations. $P$ Finally, a special case occurs when a user macro whose definition does not involve any arguments (neither named arguments nor the argument reference sequence) is called in a mode where the short user-macro end sequence is empty ($I{e.g.}$, cpp or $TeX$$nbsp$mode). In that case it is assumed to be an $I{alias macro}$: its arguments are first evaluated in the current mode as usual, but instead of being passed to the macro definition as parameters (which would cause them to be discarded) they are actually appended to the macro definition, using the syntax rules of the mode in which the macro was defined, and the resulting text is evaluated again. It is therefore important to note that, in the case of a macro alias, the arguments actually get evaluated twice in two potentially different modes. %%% %%%%%%%%%%%%%%%%%%%%% meta-macro descriptions %%%%%%%%%%%%%%%%%%%%%% $S{META-MACROS}$ $P$ These macros are always predefined. Their actual calling sequence depends on the current mode; here we use cpp-like notation. $list{ $li$ $BI{$dz$define }{x y}$ This defines the user macro $I{x}$ as $I{y}$. $I{y}$ can be any valid GPP input, and may for example refer to other macros. $I{x}$ must be an identifier ($I{i.e.}$, a sequence of alphanumeric characters and '$und$'), unless named arguments are specified. If $I{x}$ is already defined, the previous definition is overwritten. If no second argument is given, $I{x}$ will be defined as a macro that outputs nothing. Neither $I{x}$ nor $I{y}$ are evaluated; the macro definition is only evaluated when it is called, not when it is declared. $p$ It is also possible to name the arguments in a macro definition: in that case, the argument $I{x}$ should be a user-macro call whose arguments are all identifiers. These identifiers become available as user-macros inside the macro definition; these virtual macros must be called without arguments, and evaluate to the corresponding macro parameter. $li$ $BI{$dz$defeval }{x y}$ This acts in a similar way to $I{$dz$define}$, but the second argument $I{y}$ is evaluated immediately. Since user macro definitions are also evaluated each time they are called, this means that the macro $I{y}$ will undergo $I{two}$ successive evaluations. The usefulness of $I{$dz$defeval}$ is considerable as it is the only way to evaluate something more than once, which may be needed to force evaluation of the arguments of a meta-macro that normally doesn't perform any evaluation. However since all argument references evaluated at define-time are understood as the arguments of the body in which the macro is being defined and not as the arguments of the macro itself, usually one has to use the quote character to prevent immediate evaluation of argument references. $li$ $BI{$dz$undef }{x}$ This removes any existing definition of the user macro $I{x}$. $li$ $BI{$dz$ifdef }{x}$ This begins a conditional block. Everything that follows is evaluated only if the identifier $I{x}$ is defined, and until either a $I{$dz$else}$ or a $I{$dz$endif}$ statement is reached. Note, however, that the commented text is still scanned thoroughly, so its syntax must be valid. It is in particular legal to have the $I{$dz$else}$ or $I{$dz$endif}$ statement ending the conditional block appear only as the result of a user-macro expansion and not explicitly in the input. $li$ $BI{$dz$ifndef }{x}$ This begins a conditional block. Everything that follows is evaluated only if the identifier $I{x}$ is not defined. $li$ $BI{$dz$ifeq }{x y}$ This begins a conditional block. Everything that follows is evaluated only if the results of the evaluations of $I{x}$ and $I{y}$ are identical as character strings. Any leading or trailing whitespace is ignored for the comparison. Note that in cpp-mode any unquoted whitespace character is understood as the end of the first argument, so it is necessary to be careful. $li$ $BI{$dz$ifneq }{x y}$ This begins a conditional block. Everything that follows is evaluated only if the results of the evaluations of $I{x}$ and $I{y}$ are not identical (even up to leading or trailing whitespace). $li$ $BI{$dz$else}$ This toggles the logical value of the current conditional block. What follows is evaluated if and only if the preceding input was commented out. $li$ $BI{$dz$endif}$ This ends a conditional block started by a $I{$dz$if$ldots$}$ meta-macro. $li$ $BI{$dz$include }{file}$ This causes GPP to open the specified file and evaluate its contents, inserting the resulting text in the current output. All defined user macros are still available in the included file, and reciprocally all macros defined in the included file will be available in everything that follows. The include file is looked for first in the current directory, and then, if not found, in one of the directories specified by the $I{$d$I}$ command-line option (or $I{/usr/include}$ if no directory was specified). Note that, for compatibility reasons, it is possible to put the file name between "" or $l$$g$. $p$ The order in which the various directories are searched for include files is affected by the $I{$d$nostdinc}$, $I{$d$nocurinc}$ and $I{$d$curdirinclast}$ command-line options. $p$ Upon including a file, GPP immediately saves a copy of the current operating mode onto the mode stack, and restores the operating mode at the end of the included file. The included file may override this behavior by starting with a $I{$dz$mode restore}$ call and ending with a $I{$dz$mode push}$ call. Additionally, when the $I{$d$m}$ command line option is specified, GPP will automatically switch to the cpp compatibility mode upon including a file whose name ends with either '.c' or '.h'. $li$ $BI{$dz$exec }{command}$ This causes GPP to execute the specified command line and include its standard output in the current output. Note that, for security reasons, this meta-macro is disabled unless the $I{$d$x}$ command line flag was specified. If use of $I{$dz$exec}$ is not allowed, a warning message is printed and the output is left blank. Note that the specified command line is evaluated before being executed, thus allowing the use of macros in the command-line. However, the output of the command is included verbatim and not evaluated. If you need the output to be evaluated, you must use $I{$dz$defeval}$ (see above) to cause a double evaluation. $li$ $BI{$dz$eval }{expr}$ The $I{$dz$eval}$ meta-macro attempts to evaluate $I{expr}$ first by expanding macros (normal GPP evaluation) and then by performing arithmetic evaluation and/or wildcard matching. The syntax and operator precedence for arithmetic expressions are the same as in C; the only missing operators are $l$$l$, $g$$g$, ?:, and the assignment operators. $p$ POSIX-style wildcard matching ('globbing') is available only on POSIX implementations and can be invoked with the =$tilde$ operator. In brief, a '?' matches any single character, a '*' matches any string (including the empty string), and '[$ldots$]' matches any one of the characters enclosed in brackets. A '[$ldots$]' class is complemented when the first character in the brackets is '!'. The characters in a '[$ldots$]' class can also be specified as a range using the '$d$' character$mdash$$I{e.g.}$, '[F$d$N]' is equivalent to '[FGHIJKLMN]'. $p$ If unable to assign a numerical value to the result, the returned text is simply the result of macro expansion without any arithmetic evaluation. The only exceptions to this rule are the comparison operators ==, !=, $l$, $g$, $l$=, and $g$= which, if one of the sides does not evaluate to a number, perform string comparison instead (ignoring trailing and leading spaces). Additionally, the $I{length($ldots$)}$ arithmetic operator returns the length in characters of its evaluated argument. $p$ Inside arithmetic expressions, the $I{defined($ldots$)}$ special user macro is also available: it takes only one argument, which is not evaluated, and returns 1 if it is the name of a user macro and 0 otherwise. $li$ $BI{$dz$if }{expr}$ This meta-macro invokes the arithmetic/globbing evaluator in the same manner as $I{$dz$eval}$ and compares the result of evaluation with the string "0" in order to begin a conditional block. In particular note that the logical value of $I{expr}$ is always true when it cannot be evaluated to a number. $li$ $BI{$dz$elif }{expr}$ This meta-macro can be used to avoid nested $I{$dz$if}$ conditions. $I{$dz$if}$ $ldots$ $I{$dz$elif}$ $ldots$ $I{$dz$endif}$ is equivalent to $I{$dz$if}$ $ldots$ $I{$dz$else}$ $I{$dz$if}$ $ldots$ $I{$dz$endif}$ $I{$dz$endif}$. $li$ $BI{$dz$mode }{keyword $ldots$}$ This meta-macro controls GPP's operating mode. See below for a list of $I{$dz$mode}$ commands. $li$ $BI{$dz$line}$ This meta-macro evaluates to the line number of the current input file. $li$ $BI{$dz$file}$ This meta-macro evaluates to the filename of the current input file as it appears on the command line or in the argument to $I{$dz$include}$. If GPP is reading its input from stdin, then $I{$dz$file}$ evaluates to `stdin'. $li$ $BI{$dz$date }{fmt}$ This meta-macro evaluates to the current date and time as formatted by the specified format string $I{fmt}$. See the section $I{DATE AND TIME CONVERSION SPECIFIERS}$ below. $li$ $BI{$dz$error }{msg}$ This meta-macro causes an error message with the current filename and line number, and with the text $I{msg}$, to be printed to the standard error device. Subsequent processing is then aborted. $li$ $BI{$dz$warning }{msg}$ This meta-macro causes a warning message with the current filename and line number, and with the text $I{msg}$, to be printed to the standard error device. Subsequent processing is then resumed. }$ $P$ The key to GPP's flexibility is the $I{$dz$mode}$ meta-macro. Its first argument is always one of a list of available keywords (see below); its second argument is always a sequence of words separated by whitespace. Apart from possibly the first of them, each of these words is always a delimiter or syntax specifier, and should be provided as a C string delimited by double quotes ("$nbsp$"). The various special matching sequences listed in the section on syntax specification are available. Any $I{$dz$mode}$ command is parsed in a mode where "$ldots$" is understood to be a C-style string, so it is safe to put any character inside these strings. Also note that the first argument of $I{$dz$mode}$ (the keyword) is never evaluated, while the second argument is evaluated (except of course for the contents of C strings), so that the syntax specification may be obtained as the result of a macro evaluation. $P$ The available $I{$dz$mode}$ commands are: $list{ $li$ $BI{$dz$mode save / $dz$mode push}$ Push the current mode specification onto the mode stack. $li$ $BI{$dz$mode restore / $dz$mode pop}$ Pop mode specification from the mode stack. $li$ $BI{$dz$mode standard }{name}$ Select one of the standard modes. The only argument must be one of: default (default mode); cpp, C (cpp mode); tex, $TeX$$nbsp$(tex mode); html, HTML (html mode); xhtml, XHTML (xhtml mode); prolog, Prolog (prolog mode). The mode name must be given directly, not as a C string. $li$ $BI{$dz$mode user }{$s{s1}$ $ldots$ $s{s9}$}$ Specify user macro syntax. The 9 arguments, all of them C strings, are the mode specification for user macros (see the $d$U command-line option and the section on syntax specification). The meta-macro specification is not affected. $li$ $BI{$dz$mode meta }{$bra$user $pipe$ $s{s1}$ $ldots$ $s{s7}$$ket$}$ Specify meta-macro syntax. Either the only argument is $I{user}$ (not as a string), and the user-macro mode specifications are copied into the meta-macro mode specifications, or there must be seven string arguments, whose significance is the same as for the $d$M command-line option (see section on syntax specification). $li$ $BI{$dz$mode quote }{[$s{c}$]}$ With no argument or "" as argument, removes the quote character specification and disables the quoting functionality. With one string argument, the first character of the string is taken to be the new quote character. The quote character can be neither alphanumeric nor '$und$', nor can it be one of the special matching sequences. $li$ $BI{$dz$mode comment }{[xxx] $s{start}$ $s{end}$ [$s{c}$ [$s{c}$]]}$ Add a comment specification. Optionally a first argument consisting of three characters not enclosed in "$nbsp$" can be used to specify a comment/string modifier (see the section on syntax specification). The default modifier is $I{ccc}$. The first two string arguments are used as comment start and end sequences respectively. The third string argument is optional and can be used to specify a string-quote character. (If it is "", the functionality is disabled.) The fourth string argument is optional and can be used to specify a string delimitation warning character. (If it is "", the functionality is disabled.) $li$ $BI{$dz$mode string }{[xxx] $s{start}$ $s{end}$ [$s{c}$ [$s{c}$]]}$ Add a string specification. Identical to $I{$dz$mode comment}$ except that the default modifier is $I{sss}$. $li$ $BI{$dz$mode nocomment / $dz$mode nostring }{[$s{start}$]}$ With no argument, remove all comment/string specifications. With one string argument, delete the comment/string specification whose start sequence is the argument. $li$ $BI{$dz$mode preservelf }{$bra$ on $pipe$ off $pipe$ 1 $pipe$ 0 $ket$}$ Equivalent to the $I{-n}$ command-line switch. If the argument is $I{on}$ or $I{1}$, any newline or whitespace character terminating a macro call or a comment/string is left in the input stream for further processing. If the argument is $I{off}$ or $I{0}$ this feature is disabled. $li$ $BI{$dz$mode charset }{$bra$ id $pipe$ op $pipe$ par $ket$ $s{string}$}$ Specify the character sets to be used for matching the $b$o, $b$O and $b$i special sequences. The first argument must be one of $I{id}$ (the set matched by $b$i), $I{op}$ (the set matched by $b$o) or $I{par}$ (the set matched by $b$O in addition to the one matched by $b$o). $I{"string"}$ is a C string which lists all characters to put in the set. It may contain only the special matching sequences $b$a, $b$A, $b$b, $b$B, and $b$$dz$ (the other sequences and the negated sequences are not allowed). When a '-' is found inbetween two non-special characters this adds all characters inbetween (e.g. "A-Z" corresponds to all uppercase characters). To have '-' in the matched set, either put it in first or last position or place it next to a $b$x sequence. }$ $S{DATE AND TIME CONVERSION SPECIFIERS}$ Ordinary characters placed in the format string are copied to without conversion. Conversion specifiers are introduced by a `$pc$' character, and are replaced as follows: $list{ $li$ $BI{$pc$a}$ The abbreviated weekday name according to the current locale. $li$ $BI{$pc$A}$ The full weekday name according to the current locale. $li$ $BI{$pc$b}$ The abbreviated month name according to the current locale. $li$ $BI{$pc$B}$ The full month name according to the current locale. $li$ $BI{$pc$c}$ The preferred date and time representation for the current locale. $li$ $BI{$pc$d}$ The day of the month as a decimal number (range 01 to 31). $li$ $BI{$pc$F}$ Equivalent to $pc$Y-$pc$m-$pc$d (the ISO 8601 date format). $li$ $BI{$pc$H}$ The hour as a decimal number using a 24-hour clock (range 00 to 23). $li$ $BI{$pc$I}$ The hour as a decimal number using a 12-hour clock (range 01 to 12). $li$ $BI{$pc$j}$ The day of the year as a decimal number (range 001 to 366). $li$ $BI{$pc$m}$ The month as a decimal number (range 01 to 12). $li$ $BI{$pc$M}$ The minute as a decimal number (range 00 to 59). $li$ $BI{$pc$p}$ Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'. $li$ $BI{$pc$R}$ The time in 24-hour notation ($pc$H:$pc$M). $li$ $BI{$pc$S}$ The second as a decimal number (range 00 to 61). $li$ $BI{$pc$U}$ The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. $li$ $BI{$pc$w}$ The day of the week as a decimal, range 0 to 6, Sunday being 0. $li$ $BI{$pc$W}$ The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01. $li$ $BI{$pc$x}$ The preferred date representation for the current locale without the time. $li$ $BI{$pc$X}$ The preferred time representation for the current locale without the date. $li$ $BI{$pc$y}$ The year as a decimal number without a century (range 00 to 99). $li$ $BI{$pc$Y}$ The year as a decimal number including the century. $li$ $BI{$pc$Z}$ The time zone or name or abbreviation. $li$ $BI{$pc$$pc$}$ A literal `$pc$' character. }$ $P$ Depending on the C compiler and library used to compile GPP, there may be more conversion specifiers available. Consult your compiler's documentation for the $I{strftime()}$ function. Note, however, that any conversion specifiers not listed above may not be portable across installations of GPP. $S{EXAMPLES}$ Here is a basic self-explanatory example in standard or cpp mode: $pre$ $dz$define FOO This is $dz$define BAR a message. $dz$define concat $dz$1 $dz$2 concat(FOO,BAR) $dz$ifeq (concat(foo,bar)) (foo bar) This is output. $dz$else This is not output. $dz$endif $nopre$ Using argument naming, the $I{concat}$ macro could alternatively be defined as $pre$ $dz$define concat(x,y) x y $nopre$ In $TeX$$nbsp$mode and using argument naming, the same example becomes: $pre$ $b$define$bra$FOO$ket$$bra$This is$ket$ $b$define$bra$BAR$ket$$bra$a message.$ket$ $b$define$bra$$b$concat$bra$x$ket$$bra$y$ket$$ket$$bra$$b$x $b$y$ket$ $b$concat$bra$$b$FOO$ket$$bra$$b$BAR$ket$ $b$ifeq$bra$$b$concat$bra$foo$ket$$bra$bar$ket$$ket$$bra$foo bar$ket$ This is output. $b$else This is not output. $b$endif $nopre$ In HTML mode and without argument naming, one gets similarly: $pre$ $l$$dz$define FOO$pipe$This is$g$ $l$$dz$define BAR$pipe$a message.$g$ $l$$dz$define concat$pipe$$dz$1 $dz$2$g$ $l$$dz$concat $l$$dz$FOO$g$$pipe$$l$$dz$BAR$g$$g$ $l$$dz$ifeq $l$$dz$concat foo$pipe$bar$g$$pipe$foo bar$g$ This is output. $l$$dz$else$g$ This is not output. $l$$dz$endif$g$ $nopre$ The following example (in standard mode) illustrates the use of the quote character: $pre$ $dz$define FOO This is $b$ a multiline definition. $dz$define BLAH(x) My argument is x BLAH(urf) $b$BLAH(urf) $nopre$ Note that the multiline definition is also valid in cpp and Prolog modes despite the absence of quote character, because '$b$' followed by a newline is then interpreted as a comment and discarded. $P$ In cpp mode, C strings and comments are understood as such, as illustrated by the following example: $pre$ $dz$define BLAH foo BLAH "BLAH" /* BLAH */ 'It$b$'s a /*string*/ !' $nopre$ The main difference between Prolog mode and cpp mode is the handling of strings and comments: in Prolog, a '$ldots$' string may not begin immediately after a digit, and a /*$ldots$*/ comment may not begin immediately after an operator character. Furthermore, comments are not removed from the output unless they occur in a $dz$command. $P$ The differences between cpp mode and default mode are deeper: in default mode $dz$commands may start anywhere, while in cpp mode they must be at the beginning of a line; the default mode has no knowledge of comments and strings, but has a quote character ('$b$'), while cpp mode has extensive comment/string specifications but no quote character. Moreover, the arguments to meta-macros need to be correctly parenthesized in default mode, while no such checking is performed in cpp mode. $P$ This makes it easier to nest meta-macro calls in default mode than in cpp mode. For example, consider the following HTML mode input, which tests for the availability of the $I{$dz$exec}$ command: $pre$ $l$$dz$ifeq $l$$dz$exec echo blah$g$$pipe$blah $g$ $dz$exec allowed $l$$dz$else$g$ $dz$exec not allowed $l$$dz$endif$g$ $nopre$ There is no cpp mode equivalent, while in default mode it can be easily translated as $pre$ $dz$ifeq ($dz$exec echo blah ) (blah ) $b$$dz$exec allowed $dz$else $b$$dz$exec not allowed $dz$endif $nopre$ In order to nest meta-macro calls in cpp mode it is necessary to modify the mode description, either by changing the meta-macro call syntax, or more elegantly by defining a silent string and using the fact that the context at the beginning of an evaluated string is a newline character: $pre$ $dz$mode string QQQ "$dollar$" "$dollar$" $dz$ifeq $dollar$$dz$exec echo blah $dollar$ $dollar$blah $dollar$ $b$$dz$exec allowed $dz$else $b$$dz$exec not allowed $dz$endif $nopre$ Note, however, that comments/strings cannot be nested ("$ldots$" inside $dollar$$ldots$$dollar$ would go undetected), so one needs to be careful about what to include inside such a silent evaluated string. In this example, the loose meta-macro nesting introduced in version 2.1 makes it possible to use the following simpler version: $pre$ $dz$ifeq blah #exec echo -n blah $b$$dz$exec allowed $dz$else $b$$dz$exec not allowed $dz$endif $nopre$ Remember that macros without arguments are actually understood to be aliases when they are called with arguments, as illustrated by the following example (default or cpp mode): $pre$ $dz$define DUP(x) x x $dz$define FOO and I said: DUP FOO(blah) $nopre$ The usefulness of the $I{$dz$defeval}$ meta-macro is shown by the following example in HTML mode: $pre$ $l$$dz$define APPLY$pipe$$l$$dz$defeval TEMP$pipe$$l$$b$$dz$$dz$1 $b$$dz$1$g$$g$$l$$dz$TEMP $dz$2$g$$g$ $l$$dz$define $l$$dz$foo x$g$$pipe$$l$$dz$x$g$ and $l$$dz$x$g$$g$ $l$$dz$APPLY foo$pipe$BLAH$g$ $nopre$ The reason why $I{$dz$defeval}$ is needed is that, since everything is evaluated in a single pass, the input that will result in the desired macro call needs to be generated by a first evaluation of the arguments passed to APPLY before being evaluated a second time. $P$ To translate this example in default mode, one needs to resort to parenthesizing in order to nest the $dz$defeval call inside the definition of APPLY, but need to do so without outputting the parentheses. The easiest solution is $pre$ $dz$define BALANCE(x) x $dz$define APPLY(f,v) BALANCE($dz$defeval TEMP f TEMP(v)) $dz$define foo(x) x and x APPLY($b$foo,BLAH) $nopre$ As explained above the simplest version in cpp mode relies on defining a silent evaluated string to play the role of the BALANCE macro. $P$ The following example (default or cpp mode) demonstrates arithmetic evaluation: $pre$ $dz$define x 4 The answer is: $dz$eval x*x + 2*(16-x) + 1998$pc$x $dz$if defined(x)$and$$and$!(3*x+5$g$17) This should be output. $dz$endif $nopre$ To finish, here are some examples involving mode switching. The following example is self-explanatory (starting in default mode): $pre$ $dz$mode push $dz$define f(x) x x $dz$mode standard tex $b$f$bra$blah$ket$ $b$mode$bra$string$ket$$bra$"$dollar$" "$dollar$"$ket$ $b$mode$bra$comment$ket$$bra$"/*" "*/"$ket$ $dollar$$b$f$bra$urf$ket$$dollar$ /* blah */ $b$define$bra$FOO$ket$$bra$bar/* and some more */$ket$ $b$mode$bra$pop$ket$ f($dollar$FOO$dollar$) $nopre$ A good example where a user-defined mode becomes useful is the GPP source of this document (available with GPP's source code distribution). $P$ Another interesting application is selectively forcing evaluation of macros in C strings when in cpp mode. For example, consider the following input: $pre$ $dz$define blah(x) "and he said: x" blah(foo) $nopre$ Obviously one would want the parameter $I{x}$ to be expanded inside the string. There are several ways around this problem: $pre$ $dz$mode push $dz$mode nostring "$b$"" $dz$define blah(x) "and he said: x" $dz$mode pop $dz$mode quote "`" $dz$define blah(x) `"and he said: x`" $dz$mode string QQQ "$dollar$$dollar$" "$dollar$$dollar$" $dz$define blah(x) $dollar$$dollar$"and he said: x"$dollar$$dollar$ $nopre$ The first method is very natural, but has the inconvenience of being lengthy and neutralizing string semantics, so that having an unevaluated instance of 'x' in the string, or an occurrence of '/*', would be impossible without resorting to further contortions. $P$ The second method is slightly more efficient because the local presence of a quote character makes it easier to control what is evaluated and what isn't, but has the drawback that it is sometimes impossible to find a reasonable quote character without having to either significantly alter the source file or enclose it inside a $I{$dz$mode push/pop}$ construct. For example, any occurrence of '/*' in the string would have to be quoted.$P$ The last method demonstrates the efficiency of evaluated strings in the context of selective evaluation: since comments/strings cannot be nested, any occurrence of '"' or '/*' inside the '$dollar$$dollar$' gets output as plain text, as expected inside a string, and only macro evaluation is enabled. Also note that there is much more freedom in the choice of a string delimiter than in the choice of a quote character. $P$ Starting with version 2.1, meta-macro calls can be nested more efficiently in default, cpp and Prolog modes. This makes it easy to make a user version of a meta-macro, or to increment a counter: $pre$ $dz$define myeval $dz$eval $dz$1 $dz$define x 1 $dz$defeval x $dz$eval x+1 $nopre$ %%% %%%%%%%%%%%%%%%%%%%%%% advanced examples %%%%%%%%%%%%%%%%%%%%%%%%%%%% $S{ADVANCED EXAMPLES}$ $P$ Here are some examples of advanced constructions using GPP. They tend to be pretty awkward and should be considered as evidence of GPP's limitations. $P$ The first example is a recursive macro. The main problem is that (since GPP evaluates everything) a recursive macro must be very careful about the way in which recursion is terminated in order to avoid undefined behavior (most of the time GPP will simply crash). In particular, relying on a $I{$dz$if/$dz$else/$dz$endif}$ construct to end recursion is not possible and results in an infinite loop, because GPP scans user macro calls even in the unevaluated branch of the conditional block. A safe way to proceed is for example as follows (we give the example in $TeX$$nbsp$mode): $pre$ $b$define$bra$countdown$ket$$bra$ $b$if$bra$$dz$1$ket$ $dz$1... $b$define$bra$loop$ket$$bra$$b$countdown$ket$ $b$else Done. $b$define$bra$loop$ket$$bra$$ket$ $b$endif $b$loop$bra$$b$eval$bra$$dz$1-1$ket$$ket$ $ket$ $b$countdown$bra$10$ket$ $nopre$$P$ Another example, in cpp mode: $pre$ $dz$mode string QQQ "$dollar$" "$dollar$" $dz$define triangle(x,y) y $b$ $dollar$$dz$if length(y)$l$x$dollar$ $dollar$$dz$define iter triangle$dollar$ $dollar$$dz$else$dollar$ $b$ $dollar$$dz$define iter$dollar$ $dollar$$dz$endif $dollar$ iter(x,*y) triangle(20) $nopre$$P$ The following is an (unfortunately very weak) attempt at implementing functional abstraction in GPP (in standard mode). Understanding this example and why it can't be made much simpler is an exercise left to the curious reader. $pre$ $dz$mode string "`" "`" "$b$$b$" $dz$define ASIS(x) x $dz$define SILENT(x) ASIS() $dz$define EVAL(x,f,v) SILENT( $dz$mode string QQQ "`" "`" "$b$$b$" $dz$defeval TEMP0 x $dz$defeval TEMP1 ( $b$$dz$define $b$TEMP2(TEMP0) f ) TEMP1 )TEMP2(v) $dz$define LAMBDA(x,f,v) SILENT( $dz$ifneq (v) () $dz$define TEMP3(a,b,c) EVAL(a,b,c) $dz$else $dz$define TEMP3(a,b,c) $b$LAMBDA(a,b) $dz$endif )TEMP3(x,f,v) $dz$define EVALAMBDA(x,y) SILENT( $dz$defeval TEMP4 x $dz$defeval TEMP5 y ) $dz$define APPLY(f,v) SILENT( $dz$defeval TEMP6 ASIS($b$EVA)f TEMP6 )EVAL(TEMP4,TEMP5,v) $nopre$ This yields the following results: $pre$ LAMBDA(z,z+z) =$g$ LAMBDA(z,z+z) LAMBDA(z,z+z,2) =$g$ 2+2 $dz$define f LAMBDA(y,y*y) f =$g$ LAMBDA(y,y*y) APPLY(f,blah) =$g$ blah*blah APPLY(LAMBDA(t,t t),(t t)) =$g$ (t t) (t t) LAMBDA(x,APPLY(f,(x+x)),urf) =$g$ (urf+urf)*(urf+urf) APPLY(APPLY(LAMBDA(x,LAMBDA(y,x*y)),foo),bar) =$g$ foo*bar $dz$define test LAMBDA(y,`$dz$ifeq y urf y is urf$dz$else y is not urf$dz$endif `) APPLY(test,urf) =$g$ urf is urf APPLY(test,foo) =$g$ foo is not urf $nopre$ %%%%%%%%%%%%%%%%%%%%%% misc stuff at the end %%%%%%%%%%%%%%%%%%%%%%%% $ifdef{man}$ $S{SEE ALSO}$ strftime(3), glob(7), m4(1V), cpp(1)$P$ GPP home page: http://www.nothingisreal.com/gpp/ $endif$ $S{AUTHOR}$ GPP was written by Denis Auroux $l$auroux@math.mit.edu$g$. Since version 2.12 it has been maintained by Tristan Miller $l$psychonaut@nothingisreal.com$g$. $S{COPYRIGHT}$ Copyright $copy$$nbsp$1996$ndash$2001 Denis Auroux.$BR$ Copyright $copy$$nbsp$2003, 2004 Tristan Miller.$P$ Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn.$P$ Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. $ifdef{html}$ $endif$ $ifdef{latex}$ \end{document} $endif$ %%% !!! gpp-2.24/doc/gpp.html0000644000076400001440000015130610123364566010145 GPP 2.24 — Generic Preprocessor

    GPP 2.24 — Generic Preprocessor

    N.B. — The latest version of GPP and this manual are available from the GPP home page.


    DESCRIPTION

    GPP is a general-purpose preprocessor with customizable syntax, suitable for a wide range of preprocessing tasks. Its independence from any programming language makes it much more versatile than cpp, while its syntax is lighter and more flexible than that of m4.

    GPP is targeted at all common preprocessing tasks where cpp is not suitable and where no very sophisticated features are needed. In order to be able to process equally efficiently text files or source code in a variety of languages, the syntax used by GPP is fully customizable. The handling of comments and strings is especially advanced.

    Initially, GPP only understands a minimal set of built-in macros, called meta-macros. These meta-macros allow the definition of user macros as well as some basic operations forming the core of the preprocessing system, including conditional tests, arithmetic evaluation, wildcard matching (globbing), and syntax specification. All user macro definitions are global—i.e., they remain valid until explicitly removed; meta-macros cannot be redefined. With each user macro definition GPP keeps track of the corresponding syntax specification so that a macro can be safely invoked regardless of any subsequent change in operating mode.

    In addition to macros, GPP understands comments and strings, whose syntax and behavior can be widely customized to fit any particular purpose. Internally comments and strings are the same construction, so everything that applies to comments applies to strings as well.


    SYNTAX

      gpp [-{o|O} outfile] [-I/include/path] [-Dname=val ...]
          [-z|+z] [-x] [-m] [-C|-T|-H|-X|-P|-U ... [-M ...]]
          [-n|+n] [+c<n> str1 str2] [+s<n> str1 str2 c] 
          [-c str1] [--nostdinc] [--nocurinc]
          [--curdirinclast] [--warninglevel n]
          [--includemarker str] [--include file]
          [infile]
    
      gpp --help
    
      gpp --version


    OPTIONS

    GPP recognizes the following command-line switches and options. Note that the -nostdinc, -nocurinc, -curdirinclast, -warninglevel, and -includemarker options from version 2.1 and earlier are deprecated and should not be used. Use the "long option" variants instead (--nostdinc, etc.).

    • -h --help
      Print a short help message.

    • --version
      Print version information.

    • -o outfile
      Specify a file to which all output should be sent (by default, everything is sent to standard output).

    • -O outfile
      Specify a file to which all output should be sent; output is simultanously sent to stdout.

    • -I/include/path
      Specify a path where the #include meta-macro will look for include files if they are not present in the current directory. The default is /usr/include if no -I option is specified. Multiple -I options may be specified to look in several directories.

    • -Dname=val
      Define the user macro name as equal to val. This is strictly equivalent to using the #define meta-macro, but makes it possible to define macros from the command-line. If val makes references to arguments or other macros, it should conform to the syntax of the mode specified on the command-line. Starting with version 2.1, macro argument naming is allowed on the command-line. The syntax is as follows: -Dmacro(arg1,…)=definition. The arguments are specified in C-style syntax, without any whitespace, but the definition should still conform to the syntax of the mode specified on the command-line.

    • +z
      Set text mode to Unix mode (LF terminator). Any CR character in the input is systematically discarded. This is the default under Unix systems.

    • -z
      Set text mode to DOS mode (CR–LF terminator). In this mode all CR characters are removed from the input, and all output LF characters are converted to CR–LF. This is the default if GPP is compiled with the WIN_NT option.

    • -x
      Enable the use of the #exec meta-macro. Since #exec includes the output of an arbitrary shell command line, it may cause a potential security threat, and is thus disabled unless this option is specified.

    • -m
      Enable automatic mode switching to the cpp compatibility mode if the name of an included file ends in `.h' or `.c'. This makes it possible to include C header files with only minor modifications.

    • -n
      Prevent newline or whitespace characters from being removed from the input when they occur as the end of a macro call or of a comment. By default, when a newline or whitespace character forms the end of a macro or a comment it is parsed as part of the macro call or comment and therefore removed from output. Use the -n option to keep the last character in the input stream if it was whitespace or a newline. This is activated in cpp and Prolog modes.

    • +n
      The opposite of -n. This is the default in all modes except cpp and Prolog. Note that +n must be placed after -C or -P in order to have any effect.

    • -U arg1 … arg9
      User-defined mode. The nine following command-line arguments are taken to be respectively the macro start sequence, the macro end sequence for a call without arguments, the argument start sequence, the argument separator, the argument end sequence, the list of characters to stack for argument balancing, the list of characters to unstack, the string to be used for referring to an argument by number, and finally the quote character (if there is none an empty string should be provided). These settings apply both to user macros and to meta-macros, unless the -M option is used to define other settings for meta-macros. See the section on syntax specification for more details.

    • -M arg1 … arg7
      User-defined mode specifications for meta-macros. This option can only be used together with -M. The seven following command-line arguments are taken to be respectively the macro start sequence, the macro end sequence for a call without arguments, the argument start sequence, the argument separator, the argument end sequence, the list of characters to stack for argument balancing, and the list of characters to unstack. See below for more details.

    • (default mode)
      The default mode is a vaguely cpp-like mode, but it does not handle comments, and presents various incompatibilities with cpp. Typical meta-macros and user macros look like this:
        #define x y
        macro(arg,...)
      
      This mode is equivalent to
        -U "" "" "(" "," ")" "(" ")" "#" "\\"
        -M "#" "\n" " " " " "\n" "(" ")"
      

    • -C
      cpp compatibility mode. This is the mode where GPP's behavior is the closest to that of cpp. Unlike in the default mode, meta-macro expansion occurs only at the beginning of lines, and C comments and strings are understood. This mode is equivalent to
        -n -U "" "" "(" "," ")" "(" ")" "#" ""
        -M "\n#\w" "\n" " " " " "\n" "" ""
        +c "/*" "*/" +c "//" "\n" +c "\\\n" ""
        +s "\"" "\"" "\\" +s "'" "'" "\\"
      

    • -T
      TeX-like mode. In this mode, typical meta-macros and user macros look like this:
        \define{x}{y}
        \macro{arg}{...}
      
      No comments are understood. This mode is equivalent to
        -U "\\" "" "{" "}{" "}" "{" "}" "#" "@"
      

    • -H
      HTML-like mode. In this mode, typical meta-macros and user macros look like this:
        <#define x|y>
        <#macro arg|...>
      
      No comments are understood. This mode is equivalent to
        -U "<#" ">" "\B" "|" ">" "<" ">" "#" "\\"
      

    • -X
      XHTML-like mode. In this mode, typical meta-macros and user macros look like this:
        <#define x|y/>
        <#macro arg|.../>
      
      No comments are understood. This mode is equivalent to
        -U "<#" "/>" "\B" "|" "/>" "<" ">" "#" "\\"
      

    • -P
      Prolog-compatible cpp-like mode. This mode differs from the cpp compatibility mode by its handling of comments, and is equivalent to
        -n -U "" "" "(" "," ")" "(" ")" "#" ""
        -M "\n#\w" "\n" " " " " "\n" "" ""
        +ccss "\!o/*" "*/" +ccss "%" "\n" +ccii "\\\n" ""
        +s "\"" "\"" "" +s "\!#'" "'" ""
      

    • +c<n> str1 str2
      Specify comments. Any unquoted occurrence of str1 will be interpreted as the beginning of a comment. All input up to the first following occurrence of str2 will be discarded. This option may be used multiple times to specify different types of comment delimiters. The optional parameter <n> can be specified to alter the behavior of the comment and, e.g., turn it into a string or make it ignored under certain circumstances, see below.

    • -c str1
      Un-specify comments or strings. The comment/string specification whose start sequence is str1 is removed. This is useful to alter the built-in comment specifications of a standard mode—e.g., the cpp compatibility mode.

    • +s<n> str1 str2 c
      Specify strings. Any unquoted occurrence of str1 will be interpreted as the beginning of a string. All input up to the first following occurrence of str2 will be output as is without any evaluation. The delimiters themselves are output. If c is non-empty, its first character is used as a string-quote characteri.e., a character whose presence immediately before an occurrence of str2 prevents it from terminating the string. The optional parameter <n> can be specified to alter the behavior of the string and, e.g., turn it into a comment, enable macro evaluation inside the string, or make the string specification ignored under certain circumstances. See below.

    • -s str1
      Un-specify comments or strings. Identical to -c.

    • --include file
      Process file before infile

    • --nostdinc
      Do not look for include files in the standard directory /usr/include.

    • --nocurinc
      Do not look for include files in the current directory.

    • --curdirinclast
      Look for include files in the current directory after the directories specified by -I rather than before them.

    • --warninglevel n
      Set warning level to n (0, 1 or 2). Default is 2 (most verbose).

    • --includemarker str
      keep track of #include directives by inserting a marker in the output stream. The format of the marker is determined by str, which must contain three occurrences of the character % (or equivalently ?). The first occurrence is replaced with the line number, the second with the file name, and the third with 1, 2 or blank. When this option is specified in default, cpp or Prolog mode, GPP does its best to ensure that line numbers are the same in the output as in the input by inserting blank lines in the place of definitions or comments.

    • infile
      Specify an input file from which GPP reads its input. If no input file is specified, input is read from standard input.


    SYNTAX SPECIFICATION

    The syntax of a macro call is as follows: it must start with a sequence of characters matching the macro start sequence as specified in the current mode, followed immediately by the name of the macro, which must be a valid identifieri.e., a sequence of letters, digits, or underscores ("_"). The macro name must be followed by a short macro end sequence if the macro has no arguments, or by a sequence of arguments initiated by an argument start sequence. The various arguments are then separated by an argument separator, and the macro ends with a long macro end sequence.

    In all cases, the parameters of the current context—i.e., the arguments passed to the body being evaluated—can be referred to by using an argument reference sequence followed by a digit between 1 and 9. Alternatively, macro parameters may be named (see below). Furthermore, to avoid interference between the GPP syntax and the contents of the input file, a quote character is provided. The quote character can be used to prevent the interpretation of a macro call, comment, or string as anything but plain text. The quote character "protects" the following character, and always gets removed during evaluation. Two consecutive quote characters evaluate as a single quote character.

    Finally, to facilitate proper argument delimitation, certain characters can be "stacked" when they occur in a macro argument, so that the argument separator or macro end sequence are not parsed if the argument body is not balanced. This allows nesting macro calls without using quotes. If an improperly balanced argument is needed, quote characters should be added in front of some stacked characters to make it balanced.

    The macro construction sequences described above can be different for meta-macros and for user macros: this is the case in cpp mode, for example. Note that, since meta-macros can only have up to two arguments, the delimitation rules for the second argument are somewhat sloppier, and unquoted argument separator sequences are allowed in the second argument of a meta-macro.

    Unless one of the standard operating modes is selected, the above syntax sequences can be specified either on the command-line, using the -M and -U options respectively for meta-macros and user macros, or inside an input file via the #mode meta and #mode user meta-macro calls. In both cases the mode description consists of nine parameters for user macro specifications, namely the macro start sequence, the short macro end sequence, the argument start sequence, the argument separator, the long macro end sequence, the string listing characters to stack, the string listing characters to unstack, the argument reference sequence, and finally the quote character. As explained below, these sequences should be supplied using the syntax of C strings; they must start with a non-alphanumeric character, and in the first five strings special matching sequences can be used (see below). If the argument corresponding to the quote character is the empty string, that argument's functionality is disabled. For meta-macro specifications there are only seven parameters, as the argument reference sequence and quote character are shared with the user macro syntax.

    The structure of a comment/string is as follows: it must start with a sequence of characters matching the given comment/string start sequence, and always ends at the first occurrence of the comment/string end sequence, unless it is preceded by an odd number of occurrences of the string-quote character (if such a character has been specified). In certain cases comment/strings can be specified to enable macro evaluation inside the comment/string; in that case, if a quote character has been defined for macros it can be used as well to prevent the comment/string from ending, with the difference that the macro quote character is always removed from output whereas the string-quote character is always output. Also note that under certain circumstances a comment/string specification can be disabled, in which case the comment/string start sequence is simply ignored. Finally, it is possible to specify a string warning character whose presence inside a comment/string will cause GPP to output a warning (this is useful to locate unterminated strings in cpp mode). Note that input files are not allowed to contain unterminated comments/strings.

    A comment/string specification can be declared from within the input file using the #mode comment meta-macro call (or equivalently #mode string), in which case the number of C strings to be given as arguments to describe the comment/string can be anywhere between two and four: the first two arguments (mandatory) are the start sequence and the end sequence, and can make use of the special matching sequences (see below). They may not start with alphanumeric characters. The first character of the third argument, if there is one, is used as the string-quote character (use an empty string to disable the functionality), and the first character of the fourth argument, if there is one, is used as the string-warning character. A specification may also be given from the command-line, in which case there must be two arguments if using the +c option and three if using the +s option.

    The behavior of a comment/string is specified by a three-character modifier string, which may be passed as an optional argument either to the +c/+s command-line options or to the #mode comment/#mode string meta-macros. If no modifier string is specified, the default value is "ccc" for comments and "sss" for strings. The first character corresponds to the behavior inside meta-macro calls (including user-macro definitions since these come inside a #define meta-macro call), the second character corresponds to the behavior inside user-macro parameters, and the third character corresponds to the behavior outside of any macro call. Each of these characters can take the following values:

    • i: disable the comment/string specification.

    • c: comment (neither evaluated nor output).

    • s: string (the string and its delimiter sequences are output as-is).

    • q: quoted string (the string is output as-is, without the delimiter sequences).

    • C: evaluated comment (macros are evaluated, but output is discarded).

    • S: evaluated string (macros are evaluated, delimiters are output).

    • Q: evaluated quoted string (macros are evaluated, delimiters are not output).

    Important note: any occurrence of a comment/string start sequence inside another comment/string is always ignored, even if macro evaluation is enabled. In other words, comments/strings cannot be nested. In particular, the `Q' modifier can be a convenient way of defining a syntax for temporarily disabling all comment and string specifications.

    Syntax specification strings should always be provided as C strings, whether they are given as arguments to a #mode meta-macro call or on the command-line of a Unix shell. If command-line arguments are given via another method than a standard Unix shell, then the shell behavior must be emulated—i.e., the surrounding "" quotes should be removed, all occurrences of `\\' should be replaced by a single backslash, and similarly `\"' should be replaced by `"'. Sequences like `\n' are recognized by GPP and should be left as is.

    Special sequences matching certain subsets of the character set can be used. They are of the form `\x', where x is one of:

    • b: matches any sequence of one or more spaces or tab characters (`\b' is identical to ` ').

    • w: matches any sequence of zero or more spaces or tab characters.

    • B: matches any sequence of one or more spaces, tabs or newline characters.

    • W: matches any sequence of zero or more spaces, tabs or newline characters.

    • a: an alphabetic character (`a' to `z' and `A' to `Z').

    • A: an alphabetic character, or a space, tab or newline.

    • #: a digit (`0' to `9').

    • i: an identifier character. The set of matched characters is customizable using the #mode charset id command. The default setting matches alphanumeric characters and underscores (`a' to `z', `A' to `Z', `0' to `9' and `_').

    • t: a tab character.

    • n: a newline character.

    • o: an operator character. The set of matched characters is customizable using the #mode charset op command. The default setting matches all characters in "+-*/\^<>=`~:.?@#&!%|", except in Prolog mode where `!', `%' and `|' are not matched.

    • O: an operator character or a parenthesis character. The set of additional matched characters in comparison with `\o' is customizable using the #mode charset par command. The default setting is to have the characters in "()[]{}" as parentheses.

    Moreover, all of these matching subsets except `\w' and `\W' can be negated by inserting a `!'—i.e., by writing `\!x' instead of `\x'.

    Note an important distinctive feature of start sequences: when the first character of a macro or comment/string start sequence is ' ' or one of the above special sequences, it is not taken to be part of the sequence itself but is used instead as a context check: for example a start sequence beginning with '\n' matches only at the beginning of a line, but the matching newline character is not taken to be part of the sequence. Similarly a start sequence beginning with ' ' matches only if some whitespace is present, but the matching whitespace is not considered to be part of the start sequence and is therefore sent to output. If a context check is performed at the very beginning of a file (or more generally of any body to be evaluated), the result is the same as matching with a newline character (this makes it possible for a cpp-mode file to start with a meta-macro call).

    Two special syntax rules were added in version 2.1. First, argument references (#n) are no longer evaluated when they are outside of macro calls and definitions. However, they are no longer allowed to appear (unless protected by quote characters) inside a call to a defined user macro; the current behavior (backwards compatible) is to remove them silently from the input if that happens.

    Second, if the end sequence (either for macros or comments) consists of a single newline character, and if delimitation rules lead to evaluation in a context where the final newline character is absent, GPP silently ignores the missing newline instead of producing an error. The main consequence is that meta-macro calls can now be nested in a simple way in standard, cpp and Prolog modes.


    EVALUATION RULES

    Input is read sequentially and interpreted according to the rules of the current mode. All input text is first matched against the specified comment/string start sequences of the current mode (except those which are disabled by the 'i' modifier), unless the body being evaluated is the contents of a comment/string whose modifier enables macro evaluation. The most recently defined comment/string specifications are checked for first. Important note: comments may not appear between the name of a macro and its arguments (doing so results in undefined behavior).

    Anything that is not a comment/string is then matched against a possible meta-macro call, and if that fails too, against a possible user-macro call. All remaining text undergoes substitution of argument reference sequences by the relevant argument text (empty unless the body being evaluated is the definition of a user macro) and removal of the quote character if there is one.

    Note that meta-macro arguments are passed to the meta-macro prior to any evaluation (although the meta-macro may choose to evaluate them, see meta-macro descriptions below). In the case of the #mode meta-macro, GPP temporarily adds a comment/string specification to enable recognition of C strings ("…") and prevent any evaluation inside them, so no interference of the characters being put in the C string arguments to #mode with the current syntax is to be feared.

    On the other hand, the arguments to a user macro are systematically evaluated, and then passed as context parameters to the macro definition body, which gets evaluated with that environment. The only exception is when the macro definition is empty, in which case its arguments are not evaluated. Note that GPP temporarily switches back to the mode in which the macro was defined in order to evaluate it, so it is perfectly safe to change the operating mode between the time a macro is defined and the time when it is called. Conversely, if a user macro wishes to work with the current mode instead of the one that was used to define it it needs to start with a #mode restore call and end with a #mode save call.

    A user macro may be defined with named arguments (see #define description below). In that case, when the macro definition is being evaluated, each named parameter causes a temporary virtual user-macro definition to be created; such a macro may be called only without arguments and simply returns the text of the corresponding argument.

    Note that, since macros are evaluated when they are called rather than when they are defined, any attempt to call a recursive macro causes undefined behavior except in the very specific case when the macro uses #undef to erase itself after finitely many loop iterations.

    Finally, a special case occurs when a user macro whose definition does not involve any arguments (neither named arguments nor the argument reference sequence) is called in a mode where the short user-macro end sequence is empty (e.g., cpp or TeX mode). In that case it is assumed to be an alias macro: its arguments are first evaluated in the current mode as usual, but instead of being passed to the macro definition as parameters (which would cause them to be discarded) they are actually appended to the macro definition, using the syntax rules of the mode in which the macro was defined, and the resulting text is evaluated again. It is therefore important to note that, in the case of a macro alias, the arguments actually get evaluated twice in two potentially different modes.


    META-MACROS

    These macros are always predefined. Their actual calling sequence depends on the current mode; here we use cpp-like notation.

    • #define x y
      This defines the user macro x as y. y can be any valid GPP input, and may for example refer to other macros. x must be an identifier (i.e., a sequence of alphanumeric characters and '_'), unless named arguments are specified. If x is already defined, the previous definition is overwritten. If no second argument is given, x will be defined as a macro that outputs nothing. Neither x nor y are evaluated; the macro definition is only evaluated when it is called, not when it is declared.

      It is also possible to name the arguments in a macro definition: in that case, the argument x should be a user-macro call whose arguments are all identifiers. These identifiers become available as user-macros inside the macro definition; these virtual macros must be called without arguments, and evaluate to the corresponding macro parameter.

    • #defeval x y
      This acts in a similar way to #define, but the second argument y is evaluated immediately. Since user macro definitions are also evaluated each time they are called, this means that the macro y will undergo two successive evaluations. The usefulness of #defeval is considerable as it is the only way to evaluate something more than once, which may be needed to force evaluation of the arguments of a meta-macro that normally doesn't perform any evaluation. However since all argument references evaluated at define-time are understood as the arguments of the body in which the macro is being defined and not as the arguments of the macro itself, usually one has to use the quote character to prevent immediate evaluation of argument references.

    • #undef x
      This removes any existing definition of the user macro x.

    • #ifdef x
      This begins a conditional block. Everything that follows is evaluated only if the identifier x is defined, and until either a #else or a #endif statement is reached. Note, however, that the commented text is still scanned thoroughly, so its syntax must be valid. It is in particular legal to have the #else or #endif statement ending the conditional block appear only as the result of a user-macro expansion and not explicitly in the input.

    • #ifndef x
      This begins a conditional block. Everything that follows is evaluated only if the identifier x is not defined.

    • #ifeq x y
      This begins a conditional block. Everything that follows is evaluated only if the results of the evaluations of x and y are identical as character strings. Any leading or trailing whitespace is ignored for the comparison. Note that in cpp-mode any unquoted whitespace character is understood as the end of the first argument, so it is necessary to be careful.

    • #ifneq x y
      This begins a conditional block. Everything that follows is evaluated only if the results of the evaluations of x and y are not identical (even up to leading or trailing whitespace).

    • #else
      This toggles the logical value of the current conditional block. What follows is evaluated if and only if the preceding input was commented out.

    • #endif
      This ends a conditional block started by a #if… meta-macro.

    • #include file
      This causes GPP to open the specified file and evaluate its contents, inserting the resulting text in the current output. All defined user macros are still available in the included file, and reciprocally all macros defined in the included file will be available in everything that follows. The include file is looked for first in the current directory, and then, if not found, in one of the directories specified by the -I command-line option (or /usr/include if no directory was specified). Note that, for compatibility reasons, it is possible to put the file name between "" or <>.

      The order in which the various directories are searched for include files is affected by the -nostdinc, -nocurinc and -curdirinclast command-line options.

      Upon including a file, GPP immediately saves a copy of the current operating mode onto the mode stack, and restores the operating mode at the end of the included file. The included file may override this behavior by starting with a #mode restore call and ending with a #mode push call. Additionally, when the -m command line option is specified, GPP will automatically switch to the cpp compatibility mode upon including a file whose name ends with either '.c' or '.h'.

    • #exec command
      This causes GPP to execute the specified command line and include its standard output in the current output. Note that, for security reasons, this meta-macro is disabled unless the -x command line flag was specified. If use of #exec is not allowed, a warning message is printed and the output is left blank. Note that the specified command line is evaluated before being executed, thus allowing the use of macros in the command-line. However, the output of the command is included verbatim and not evaluated. If you need the output to be evaluated, you must use #defeval (see above) to cause a double evaluation.

    • #eval expr
      The #eval meta-macro attempts to evaluate expr first by expanding macros (normal GPP evaluation) and then by performing arithmetic evaluation and/or wildcard matching. The syntax and operator precedence for arithmetic expressions are the same as in C; the only missing operators are <<, >>, ?:, and the assignment operators.

      POSIX-style wildcard matching ('globbing') is available only on POSIX implementations and can be invoked with the =~ operator. In brief, a '?' matches any single character, a '*' matches any string (including the empty string), and '[…]' matches any one of the characters enclosed in brackets. A '[…]' class is complemented when the first character in the brackets is '!'. The characters in a '[…]' class can also be specified as a range using the '-' character—e.g., '[F-N]' is equivalent to '[FGHIJKLMN]'.

      If unable to assign a numerical value to the result, the returned text is simply the result of macro expansion without any arithmetic evaluation. The only exceptions to this rule are the comparison operators ==, !=, <, >, <=, and >= which, if one of the sides does not evaluate to a number, perform string comparison instead (ignoring trailing and leading spaces). Additionally, the length(…) arithmetic operator returns the length in characters of its evaluated argument.

      Inside arithmetic expressions, the defined(…) special user macro is also available: it takes only one argument, which is not evaluated, and returns 1 if it is the name of a user macro and 0 otherwise.

    • #if expr
      This meta-macro invokes the arithmetic/globbing evaluator in the same manner as #eval and compares the result of evaluation with the string "0" in order to begin a conditional block. In particular note that the logical value of expr is always true when it cannot be evaluated to a number.

    • #elif expr
      This meta-macro can be used to avoid nested #if conditions. #if#elif#endif is equivalent to #if#else #if#endif #endif.

    • #mode keyword …
      This meta-macro controls GPP's operating mode. See below for a list of #mode commands.

    • #line
      This meta-macro evaluates to the line number of the current input file.

    • #file
      This meta-macro evaluates to the filename of the current input file as it appears on the command line or in the argument to #include. If GPP is reading its input from stdin, then #file evaluates to `stdin'.

    • #date fmt
      This meta-macro evaluates to the current date and time as formatted by the specified format string fmt. See the section DATE AND TIME CONVERSION SPECIFIERS below.

    • #error msg
      This meta-macro causes an error message with the current filename and line number, and with the text msg, to be printed to the standard error device. Subsequent processing is then aborted.

    • #warning msg
      This meta-macro causes a warning message with the current filename and line number, and with the text msg, to be printed to the standard error device. Subsequent processing is then resumed.

    The key to GPP's flexibility is the #mode meta-macro. Its first argument is always one of a list of available keywords (see below); its second argument is always a sequence of words separated by whitespace. Apart from possibly the first of them, each of these words is always a delimiter or syntax specifier, and should be provided as a C string delimited by double quotes (" "). The various special matching sequences listed in the section on syntax specification are available. Any #mode command is parsed in a mode where "…" is understood to be a C-style string, so it is safe to put any character inside these strings. Also note that the first argument of #mode (the keyword) is never evaluated, while the second argument is evaluated (except of course for the contents of C strings), so that the syntax specification may be obtained as the result of a macro evaluation.

    The available #mode commands are:

    • #mode save / #mode push
      Push the current mode specification onto the mode stack.

    • #mode restore / #mode pop
      Pop mode specification from the mode stack.

    • #mode standard name
      Select one of the standard modes. The only argument must be one of: default (default mode); cpp, C (cpp mode); tex, TeX (tex mode); html, HTML (html mode); xhtml, XHTML (xhtml mode); prolog, Prolog (prolog mode). The mode name must be given directly, not as a C string.

    • #mode user "s1" … "s9"
      Specify user macro syntax. The 9 arguments, all of them C strings, are the mode specification for user macros (see the -U command-line option and the section on syntax specification). The meta-macro specification is not affected.

    • #mode meta {user | "s1" … "s7"}
      Specify meta-macro syntax. Either the only argument is user (not as a string), and the user-macro mode specifications are copied into the meta-macro mode specifications, or there must be seven string arguments, whose significance is the same as for the -M command-line option (see section on syntax specification).

    • #mode quote ["c"]
      With no argument or "" as argument, removes the quote character specification and disables the quoting functionality. With one string argument, the first character of the string is taken to be the new quote character. The quote character can be neither alphanumeric nor '_', nor can it be one of the special matching sequences.

    • #mode comment [xxx] "start" "end" ["c" ["c"]]
      Add a comment specification. Optionally a first argument consisting of three characters not enclosed in " " can be used to specify a comment/string modifier (see the section on syntax specification). The default modifier is ccc. The first two string arguments are used as comment start and end sequences respectively. The third string argument is optional and can be used to specify a string-quote character. (If it is "", the functionality is disabled.) The fourth string argument is optional and can be used to specify a string delimitation warning character. (If it is "", the functionality is disabled.)

    • #mode string [xxx] "start" "end" ["c" ["c"]]
      Add a string specification. Identical to #mode comment except that the default modifier is sss.

    • #mode nocomment / #mode nostring ["start"]
      With no argument, remove all comment/string specifications. With one string argument, delete the comment/string specification whose start sequence is the argument.

    • #mode preservelf { on | off | 1 | 0 }
      Equivalent to the -n command-line switch. If the argument is on or 1, any newline or whitespace character terminating a macro call or a comment/string is left in the input stream for further processing. If the argument is off or 0 this feature is disabled.

    • #mode charset { id | op | par } "string"
      Specify the character sets to be used for matching the \o, \O and \i special sequences. The first argument must be one of id (the set matched by \i), op (the set matched by \o) or par (the set matched by \O in addition to the one matched by \o). "string" is a C string which lists all characters to put in the set. It may contain only the special matching sequences \a, \A, \b, \B, and \# (the other sequences and the negated sequences are not allowed). When a '-' is found inbetween two non-special characters this adds all characters inbetween (e.g. "A-Z" corresponds to all uppercase characters). To have '-' in the matched set, either put it in first or last position or place it next to a \x sequence.


    DATE AND TIME CONVERSION SPECIFIERS

    Ordinary characters placed in the format string are copied to without conversion. Conversion specifiers are introduced by a `%' character, and are replaced as follows:

    • %a
      The abbreviated weekday name according to the current locale.

    • %A
      The full weekday name according to the current locale.

    • %b
      The abbreviated month name according to the current locale.

    • %B
      The full month name according to the current locale.

    • %c
      The preferred date and time representation for the current locale.

    • %d
      The day of the month as a decimal number (range 01 to 31).

    • %F
      Equivalent to %Y-%m-%d (the ISO 8601 date format).

    • %H
      The hour as a decimal number using a 24-hour clock (range 00 to 23).

    • %I
      The hour as a decimal number using a 12-hour clock (range 01 to 12).

    • %j
      The day of the year as a decimal number (range 001 to 366).

    • %m
      The month as a decimal number (range 01 to 12).

    • %M
      The minute as a decimal number (range 00 to 59).

    • %p
      Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'.

    • %R
      The time in 24-hour notation (%H:%M).

    • %S
      The second as a decimal number (range 00 to 61).

    • %U
      The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01.

    • %w
      The day of the week as a decimal, range 0 to 6, Sunday being 0.

    • %W
      The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.

    • %x
      The preferred date representation for the current locale without the time.

    • %X
      The preferred time representation for the current locale without the date.

    • %y
      The year as a decimal number without a century (range 00 to 99).

    • %Y
      The year as a decimal number including the century.

    • %Z
      The time zone or name or abbreviation.

    • %%
      A literal `%' character.

    Depending on the C compiler and library used to compile GPP, there may be more conversion specifiers available. Consult your compiler's documentation for the strftime() function. Note, however, that any conversion specifiers not listed above may not be portable across installations of GPP.


    EXAMPLES

    Here is a basic self-explanatory example in standard or cpp mode:
      #define FOO This is
      #define BAR a message.
      #define concat #1 #2
      concat(FOO,BAR)
      #ifeq (concat(foo,bar)) (foo bar)
      This is output.
      #else
      This is not output.
      #endif
    
    Using argument naming, the concat macro could alternatively be defined as
      #define concat(x,y) x y
    
    In TeX mode and using argument naming, the same example becomes:
      \define{FOO}{This is}
      \define{BAR}{a message.}
      \define{\concat{x}{y}}{\x \y}
      \concat{\FOO}{\BAR}
      \ifeq{\concat{foo}{bar}}{foo bar}
      This is output.
      \else
      This is not output.
      \endif
    
    In HTML mode and without argument naming, one gets similarly:
      <#define FOO|This is>
      <#define BAR|a message.>
      <#define concat|#1 #2>
      <#concat <#FOO>|<#BAR>>
      <#ifeq <#concat foo|bar>|foo bar>
      This is output.
      <#else>
      This is not output.
      <#endif>
    
    The following example (in standard mode) illustrates the use of the quote character:
      #define FOO This is \
         a multiline definition.
      #define BLAH(x) My argument is x
      BLAH(urf)
      \BLAH(urf)
    
    Note that the multiline definition is also valid in cpp and Prolog modes despite the absence of quote character, because '\' followed by a newline is then interpreted as a comment and discarded.

    In cpp mode, C strings and comments are understood as such, as illustrated by the following example:

      #define BLAH foo
      BLAH "BLAH" /* BLAH */
      'It\'s a /*string*/ !'
    
    The main difference between Prolog mode and cpp mode is the handling of strings and comments: in Prolog, a '…' string may not begin immediately after a digit, and a /*…*/ comment may not begin immediately after an operator character. Furthermore, comments are not removed from the output unless they occur in a #command.

    The differences between cpp mode and default mode are deeper: in default mode #commands may start anywhere, while in cpp mode they must be at the beginning of a line; the default mode has no knowledge of comments and strings, but has a quote character ('\'), while cpp mode has extensive comment/string specifications but no quote character. Moreover, the arguments to meta-macros need to be correctly parenthesized in default mode, while no such checking is performed in cpp mode.

    This makes it easier to nest meta-macro calls in default mode than in cpp mode. For example, consider the following HTML mode input, which tests for the availability of the #exec command:

      <#ifeq <#exec echo blah>|blah
      > #exec allowed <#else> #exec not allowed <#endif>
    
    There is no cpp mode equivalent, while in default mode it can be easily translated as
      #ifeq (#exec echo blah
      ) (blah
      )
      \#exec allowed
      #else
      \#exec not allowed
      #endif
    
    In order to nest meta-macro calls in cpp mode it is necessary to modify the mode description, either by changing the meta-macro call syntax, or more elegantly by defining a silent string and using the fact that the context at the beginning of an evaluated string is a newline character:
      #mode string QQQ "$" "$"
      #ifeq $#exec echo blah
      $ $blah
      $
      \#exec allowed
      #else
      \#exec not allowed
      #endif
    
    Note, however, that comments/strings cannot be nested ("…" inside $…$ would go undetected), so one needs to be careful about what to include inside such a silent evaluated string. In this example, the loose meta-macro nesting introduced in version 2.1 makes it possible to use the following simpler version:
      #ifeq blah #exec echo -n blah
      \#exec allowed
      #else
      \#exec not allowed
      #endif
    
    Remember that macros without arguments are actually understood to be aliases when they are called with arguments, as illustrated by the following example (default or cpp mode):
      #define DUP(x) x x
      #define FOO and I said: DUP
      FOO(blah)
    
    The usefulness of the #defeval meta-macro is shown by the following example in HTML mode:
      <#define APPLY|<#defeval TEMP|<\##1 \#1>><#TEMP #2>>
      <#define <#foo x>|<#x> and <#x>>
      <#APPLY foo|BLAH>
    
    The reason why #defeval is needed is that, since everything is evaluated in a single pass, the input that will result in the desired macro call needs to be generated by a first evaluation of the arguments passed to APPLY before being evaluated a second time.

    To translate this example in default mode, one needs to resort to parenthesizing in order to nest the #defeval call inside the definition of APPLY, but need to do so without outputting the parentheses. The easiest solution is

      #define BALANCE(x) x
      #define APPLY(f,v) BALANCE(#defeval TEMP f
      TEMP(v))
      #define foo(x) x and x
      APPLY(\foo,BLAH)
    
    As explained above the simplest version in cpp mode relies on defining a silent evaluated string to play the role of the BALANCE macro.

    The following example (default or cpp mode) demonstrates arithmetic evaluation:

      #define x 4
      The answer is:
      #eval x*x + 2*(16-x) + 1998%x
    
      #if defined(x)&&!(3*x+5>17)
      This should be output.
      #endif
    
    To finish, here are some examples involving mode switching. The following example is self-explanatory (starting in default mode):
      #mode push
      #define f(x) x x
      #mode standard tex
      \f{blah}
      \mode{string}{"$" "$"}
      \mode{comment}{"/*" "*/"}
      $\f{urf}$ /* blah */
      \define{FOO}{bar/* and some more */}
      \mode{pop}
      f($FOO$)
    
    A good example where a user-defined mode becomes useful is the GPP source of this document (available with GPP's source code distribution).

    Another interesting application is selectively forcing evaluation of macros in C strings when in cpp mode. For example, consider the following input:

      #define blah(x) "and he said: x"
      blah(foo)
    
    Obviously one would want the parameter x to be expanded inside the string. There are several ways around this problem:
      #mode push
      #mode nostring "\""
      #define blah(x) "and he said: x"
      #mode pop
    
      #mode quote "`"
      #define blah(x) `"and he said: x`"
    
      #mode string QQQ "$$" "$$"
      #define blah(x) $$"and he said: x"$$
    
    The first method is very natural, but has the inconvenience of being lengthy and neutralizing string semantics, so that having an unevaluated instance of 'x' in the string, or an occurrence of '/*', would be impossible without resorting to further contortions.

    The second method is slightly more efficient because the local presence of a quote character makes it easier to control what is evaluated and what isn't, but has the drawback that it is sometimes impossible to find a reasonable quote character without having to either significantly alter the source file or enclose it inside a #mode push/pop construct. For example, any occurrence of '/*' in the string would have to be quoted.

    The last method demonstrates the efficiency of evaluated strings in the context of selective evaluation: since comments/strings cannot be nested, any occurrence of '"' or '/*' inside the '$$' gets output as plain text, as expected inside a string, and only macro evaluation is enabled. Also note that there is much more freedom in the choice of a string delimiter than in the choice of a quote character.

    Starting with version 2.1, meta-macro calls can be nested more efficiently in default, cpp and Prolog modes. This makes it easy to make a user version of a meta-macro, or to increment a counter:

      #define myeval #eval #1
    
      #define x 1
      #defeval x #eval x+1
    


    ADVANCED EXAMPLES

    Here are some examples of advanced constructions using GPP. They tend to be pretty awkward and should be considered as evidence of GPP's limitations.

    The first example is a recursive macro. The main problem is that (since GPP evaluates everything) a recursive macro must be very careful about the way in which recursion is terminated in order to avoid undefined behavior (most of the time GPP will simply crash). In particular, relying on a #if/#else/#endif construct to end recursion is not possible and results in an infinite loop, because GPP scans user macro calls even in the unevaluated branch of the conditional block. A safe way to proceed is for example as follows (we give the example in TeX mode):

      \define{countdown}{
        \if{#1}
        #1...
        \define{loop}{\countdown}
        \else
        Done.
        \define{loop}{}
        \endif
        \loop{\eval{#1-1}}
      }
      \countdown{10}
    

    Another example, in cpp mode:

      #mode string QQQ "$" "$"
      #define triangle(x,y) y \
       $#if length(y)<x$ $#define iter triangle$ $#else$ \
       $#define iter$ $#endif
      $ iter(x,*y)
      triangle(20)
    

    The following is an (unfortunately very weak) attempt at implementing functional abstraction in GPP (in standard mode). Understanding this example and why it can't be made much simpler is an exercise left to the curious reader.

      #mode string "`" "`" "\\"
      #define ASIS(x) x
      #define SILENT(x) ASIS()
      #define EVAL(x,f,v) SILENT(
        #mode string QQQ "`" "`" "\\"
        #defeval TEMP0 x
        #defeval TEMP1 (
          \#define \TEMP2(TEMP0) f
        )
        TEMP1
        )TEMP2(v)
      #define LAMBDA(x,f,v) SILENT(
        #ifneq (v) ()
        #define TEMP3(a,b,c) EVAL(a,b,c)
        #else
        #define TEMP3(a,b,c) \LAMBDA(a,b)
        #endif
        )TEMP3(x,f,v)
      #define EVALAMBDA(x,y) SILENT(
        #defeval TEMP4 x
        #defeval TEMP5 y
        ) 
      #define APPLY(f,v) SILENT(
        #defeval TEMP6 ASIS(\EVA)f
        TEMP6
        )EVAL(TEMP4,TEMP5,v)
    
    This yields the following results:
      LAMBDA(z,z+z)
        => LAMBDA(z,z+z)
    
      LAMBDA(z,z+z,2)
        => 2+2
    
      #define f LAMBDA(y,y*y)
      f
        => LAMBDA(y,y*y)
    
      APPLY(f,blah)
        => blah*blah
    
      APPLY(LAMBDA(t,t t),(t t))
        => (t t) (t t)
    
      LAMBDA(x,APPLY(f,(x+x)),urf)
        => (urf+urf)*(urf+urf)
    
      APPLY(APPLY(LAMBDA(x,LAMBDA(y,x*y)),foo),bar)
        => foo*bar
    
      #define test LAMBDA(y,`#ifeq y urf
      y is urf#else
      y is not urf#endif
      `)
      APPLY(test,urf)
        => urf is urf
    
      APPLY(test,foo)
        => foo is not urf
    


    AUTHOR

    GPP was written by Denis Auroux <auroux@math.mit.edu>. Since version 2.12 it has been maintained by Tristan Miller <psychonaut@nothingisreal.com>.


    COPYRIGHT

    Copyright © 1996–2001 Denis Auroux.
    Copyright © 2003, 2004 Tristan Miller.

    Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn.

    Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. gpp-2.24/src/0000777000076400001440000000000010123366424006564 5gpp-2.24/src/gpp.c0000644000076400001440000023714510123364704007445 /* File: gpp.c -- generic preprocessor ** Author: Denis Auroux, Tristan Miller ** Contact: psychonaut@nothingisreal.com ** ** Copyright (C) 1996, 1999, 2001 Denis Auroux ** Copyright (C) 2003, 2004 Tristan Miller ** ** GPP is free software; you can redistribute it and/or modify it under the ** terms of the GNU Lesser General Public License as published by the Free ** Software Foundation; either version 2.1 of the License, or (at your option) ** any later version. ** ** GPP 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 Lesser General Public License for ** more details. ** ** You should have received a copy of the GNU Lesser General Public License ** along with this software; if not, write to the Free Software Foundation, ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: gpp.c,v 1.10 2004/09/19 20:19:16 psy Exp $ ** */ /* To compile under MS VC++, one must define WIN_NT */ #if HAVE_CONFIG_H # include #endif #ifdef WIN_NT /* WIN NT settings */ #define popen _popen #define pclose _pclose #define my_strdup _strdup #define my_strcasecmp _stricmp #define SLASH '\\' #define DEFAULT_CRLF 1 #else /* UNIX settings */ #define SLASH '/' #define DEFAULT_CRLF 0 #endif #include #include #include #include #if HAVE_FNMATCH_H # include #endif #include #define STACKDEPTH 50 #define MAXARGS 100 #define MAXINCL 10 /* max # of include dirs */ #define MAX_GPP_NUM_SIZE 15 #define MAX_GPP_DATE_SIZE 1024 typedef struct MODE { char *mStart; /* before macro name */ char *mEnd; /* end macro without arg */ char *mArgS; /* start 1st argument */ char *mArgSep; /* separate arguments */ char *mArgE; /* end last argument */ char *mArgRef; /* how to refer to arguments in a def */ char quotechar; /* quote next char */ char *stackchar; /* characters to stack */ char *unstackchar ; /* characters to unstack */ } MODE; /* translation for delimiters : \001 = \b = ' ' = one or more spaces \201 = \!b = non-space \002 = \w = zero or more spaces \003 = \B = one or more spaces or \n \203 = \!B = non-space nor \n \004 = \W = zero or more spaces or \n \005 = \a = alphabetic (a-z, A-Z) \205 = \!a = non-alphabetic \006 = \A = alphabetic or space/\n \206 = \!A \007 = \# = numeric (0-9) \207 = \!# \010 = \i = identifier (a-zA-Z0-9_) \210 = \!i \011 = \t, \012 = \n \211 = \!t, \212 = \!n \013 = \o = operator (+-*\/^<>=`~:.?@#&!%|) \213 = \!o \014 = \O = operator or ()[]{} \214 = \!O */ /* st end args sep arge ref quot stk unstk*/ struct MODE CUser = {"", "", "(", ",", ")", "#", '\\', "(", ")" }; struct MODE CMeta = {"#", "\n", "\001","\001","\n","#", '\\', "(", ")" }; struct MODE KUser = {"", "", "(", ",", ")", "#", 0, "(", ")" }; struct MODE KMeta = {"\n#\002","\n", "\001","\001","\n","#", 0, "", "" }; struct MODE Tex = {"\\", "", "{", "}{", "}", "#", '@', "{", "}" }; struct MODE Html = {"<#", ">", "\003","|", ">", "#", '\\', "<", ">" }; struct MODE XHtml = {"<#", "/>", "\003","|", "/>","#", '\\', "<", ">" }; #define DEFAULT_OP_STRING (unsigned char *)"+-*/\\^<>=`~:.?@#&!%|" #define PROLOG_OP_STRING (unsigned char *)"+-*/\\^<>=`~:.?@#&" #define DEFAULT_OP_PLUS (unsigned char *)"()[]{}" #define DEFAULT_ID_STRING (unsigned char *)"\005\007_" /* or equiv. "A-Za-z0-9_" */ /* here we assume that longs are at least 32 bit... if not, change this ! */ #define LOG_LONG_BITS 5 #define CHARSET_SUBSET_LEN (256>>LOG_LONG_BITS) typedef unsigned long *CHARSET_SUBSET; CHARSET_SUBSET DefaultOp,DefaultExtOp,PrologOp,DefaultId; typedef struct COMMENT { char *start; /* how the comment/string starts */ char *end; /* how it ends */ char quote; /* how to prevent it from ending */ char warn; /* a character that shouldn't be in there */ int flags[3]; /* meta, user, text */ struct COMMENT *next; } COMMENT; #define OUTPUT_TEXT 0x1 /* what's inside will be output */ #define OUTPUT_DELIM 0x2 /* the delimiters will be output */ #define PARSE_MACROS 0x4 /* macros inside will be parsed */ #define FLAG_IGNORE 0x40 #define FLAG_STRING (OUTPUT_TEXT|OUTPUT_DELIM) #define FLAG_COMMENT 0 #define FLAG_META 0 #define FLAG_USER 1 #define FLAG_TEXT 2 /* Some stuff I removed because it made for some impossible situations : #define PARSE_COMMENTS 0x8 comments inside comments will not be parsed because nesting comments is too complicated (syntax conflicts, esp. to find a comment's end) -- of course, unless the comment is ignored. #define MACRO_FRIENDLY 0x20 a comment-end is to be processed even if an unfinished macro call has started inside the comment, otherwise it's too hard do decide in advance where a comment ends. In particular foo('bar((((') is valid. #define PREVENT_DELIM 0x10 all comments will prevent macro delimitation, i.e. foo('bar) is invalid. -- of course, unless the comment is ignored. Too bad, #define foo '... terminates only at following "'". Unless one adds quotechars like in #define foo \' ... ALSO NOTE : comments are not allowed before the end of the first argument to a meta-macro. E.g. this is legal : #define foo <* blah *> 3 This is not legal : #define <* blah *> foo 3 If a comment occurs here, the behavior depends on the actual meta-macro : most will yield an error and stop gpp (#define, #undef, #ifdef/ifndef, #defeval, #include, #mode) ; #exec, #if and #eval should be ok ; #ifeq will always fail while #ifneq will always succeed ; */ typedef struct SPECS { struct MODE User,Meta; struct COMMENT *comments; struct SPECS *stack_next; int preservelf; CHARSET_SUBSET op_set,ext_op_set,id_set; } SPECS; struct SPECS *S; typedef struct MACRO { char *username,*macrotext,**argnames; int macrolen,nnamedargs; struct SPECS *define_specs; int defined_in_comment; } MACRO; struct MACRO *macros; int nmacros,nalloced; char *includedir[MAXINCL]; int nincludedirs; int execallowed; int dosmode; int autoswitch; /* must be a format-like string that has % % % in it. The first % is replaced with line number, the second with "filename", and the third with 1, 2 or blank Can also use ? instead of %. */ char *include_directive_marker = NULL; short WarningLevel = 2; /* controls if standard dirs, like /usr/include, are to be searched for #include and whether the current dir is to be searched first or last. */ int NoStdInc = 0; int NoCurIncFirst = 0; int CurDirIncLast = 0; int file_and_stdout = 0; char *IncludeFile = NULL; typedef struct OUTPUTCONTEXT { char *buf; int len,bufsize; FILE *f; } OUTPUTCONTEXT; typedef struct INPUTCONTEXT { char *buf; char *malloced_buf; /* what was actually malloc-ed (buf may have shifted) */ int len,bufsize; int lineno; char *filename; FILE *in; int argc; char **argv; char **namedargs; struct OUTPUTCONTEXT *out; int eof; int in_comment; int ambience; /* FLAG_TEXT, FLAG_USER or FLAG_META */ int may_have_args; } INPUTCONTEXT; struct INPUTCONTEXT *C; int commented[STACKDEPTH],iflevel; /* commented = 0: output, 1: not output, 2: not output because we're in a #elif and we've already gone through the right case (so #else/#elif can't toggle back to output) */ void ProcessContext(void); /* the main loop */ int findIdent(const char *b,int l); void delete_macro(int i); /* various recent additions */ void usage(void); void display_version(void); void bug(const char *s); void warning(const char *s); static void getDirname(const char *fname, char *dirname); static FILE *openInCurrentDir(const char *incfile); char *ArithmEval(int pos1,int pos2); void replace_definition_with_blank_lines(const char *start, const char *end, int skip); void replace_directive_with_blank_line(FILE *file); void write_include_marker(FILE *f, int lineno, char *filename, const char *marker); void construct_include_directive_marker(char **include_directive_marker, const char *includemarker_input); void escape_backslashes(const char *instr, char **outstr); static void DoInclude(char *file_name); /* ** strdup() and my_strcasecmp() are not ANSI C, so here we define our own ** versions in case the compiler does not support them */ #if ! HAVE_STRDUP inline char *my_strdup(const char *s); inline char *my_strdup(const char *s) { size_t len=strlen(s) + 1; char *newstr=malloc(len); return newstr ? (char *)memcpy(newstr, s, len) : NULL; } #else # undef my_strdup # define my_strdup strdup #endif #if ! HAVE_STRCASECMP int my_strcasecmp(const char *s, const char *s2) { do { char c1=tolower(*s); char c2=tolower(*s2); if (c1>c2) return 1; if (c1filename,C->lineno,s); exit(EXIT_FAILURE); } void warning(const char *s) { fprintf(stderr,"%s:%d: warning: %s\n",C->filename,C->lineno,s); } struct SPECS *CloneSpecs(const struct SPECS *Q) { struct SPECS *P; struct COMMENT *x,*y; P=malloc(sizeof *P); if (P==NULL) bug("Out of memory."); memcpy(P,Q,sizeof(struct SPECS)); P->stack_next=NULL; if (Q->comments!=NULL) P->comments=malloc(sizeof *(P->comments)); for (x=Q->comments,y=P->comments;x!=NULL;x=x->next,y=y->next) { memcpy(y,x,sizeof(struct COMMENT)); y->start=my_strdup(x->start); y->end=my_strdup(x->end); if (x->next!=NULL) y->next=malloc(sizeof *(y->next)); } return P; } void FreeComments(struct SPECS *Q) { struct COMMENT *p; while (Q && Q->comments!=NULL) { p=Q->comments; Q->comments=p->next; free(p->start); free(p->end); free(p); } } void PushSpecs(const struct SPECS *X) { struct SPECS *P; P=CloneSpecs(X); P->stack_next=S; S=P; } void PopSpecs(void) { struct SPECS *P; P=S; S=P->stack_next; FreeComments(P); free(P); if (S==NULL) bug("#mode restore without #mode save"); } void display_version(void) { fprintf(stderr, PACKAGE_STRING "\n"); fprintf(stderr,"Copyright (C) 1996-2001 Denis Auroux\n"); fprintf(stderr,"Copyright (C) 2003, 2004 Tristan Miller\n"); fprintf(stderr, "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" ); } void usage(void) { fprintf(stderr,"Usage : gpp [-{o|O} outfile] [-I/include/path] [-Dname=val ...] [-z] [-x] [-m]\n"); fprintf(stderr," [-n] [-C | -T | -H | -X | -P | -U ... [-M ...]] [+c str1 str2]\n"); fprintf(stderr," [+s str1 str2 c] [long options] [infile]\n\n"); fprintf(stderr," default: #define x y macro(arg,...)\n"); fprintf(stderr," -C : maximum cpp compatibility (includes -n, +c, +s, ...)\n"); fprintf(stderr," -T : TeX-like \\define{x}{y} \\macro{arg}{...}\n"); fprintf(stderr," -H : HTML-like <#define x|y> <#macro arg|...>\n"); fprintf(stderr," -X : XHTML-like <#define x|y/> <#macro arg|.../>\n"); fprintf(stderr," -P : prolog compatible cpp-like mode\n"); fprintf(stderr," -U : user-defined syntax (specified in 9 following args; see manual)\n"); fprintf(stderr," -M : user-defined syntax for meta-macros (specified in 7 following args)\n\n"); fprintf(stderr," -o : output to outfile\n"); fprintf(stderr," -O : output to outfile and stdout\n"); fprintf(stderr," -z : line terminator is CR-LF (MS-DOS style)\n"); fprintf(stderr," -x : enable #exec built-in macro\n"); fprintf(stderr," -m : enable automatic mode switching upon including .h/.c files\n"); fprintf(stderr," -n : send LF characters serving as macro terminators to output\n"); fprintf(stderr," +c : use next 2 args as comment start and comment end sequences\n"); fprintf(stderr," +s : use next 3 args as string start, end and quote character\n\n"); fprintf(stderr," Long options:\n"); fprintf(stderr," --include file : process file before infile\n"); fprintf(stderr," --nostdinc : don't search standard directories for files to include\n"); fprintf(stderr," --nocurinc : don't search the current directory for files to include\n"); fprintf(stderr," --curdirinclast : search the current directory last\n"); fprintf(stderr," --warninglevel n : set warning level\n"); fprintf(stderr," --includemarker formatstring : keep track of #include directives in output\n\n"); fprintf(stderr," --version : display version information and exit\n"); fprintf(stderr," -h, --help : display this message and exit\n\n"); } int isdelim(unsigned char c) { if (c>=128) return 0; if ((c>='0')&&(c<='9')) return 0; if ((c>='A')&&(c<='Z')) return 0; if ((c>='a')&&(c<='z')) return 0; if (c=='_') return 0; return 1; } int iswhite(char c) { if (c==' ') return 1; if (c=='\t') return 1; if (c=='\n') return 1; return 0; } void newmacro(const char *s,int len,int hasspecs) { if (nmacros==nalloced) { nalloced=2*nalloced+1; macros=realloc(macros,nalloced*sizeof *macros); if (macros==NULL) bug("Out of memory"); } macros[nmacros].username=malloc(len+1); strncpy(macros[nmacros].username,s,len); macros[nmacros].username[len]=0; macros[nmacros].argnames=NULL; macros[nmacros].nnamedargs=0; macros[nmacros].defined_in_comment=0; if (hasspecs) macros[nmacros].define_specs=CloneSpecs(S); else macros[nmacros].define_specs=NULL; } void lookupArgRefs(int n) { int i,l; char *p; if (macros[n].argnames!=NULL) return; /* don't mess with those */ macros[n].nnamedargs=-1; l=strlen(S->User.mArgRef); for (i=0,p=macros[n].macrotext;iUser.quotechar)) { i++; p++; } else if (!strncmp(p,S->User.mArgRef,l)) if ((p[l]>='1')&&(p[l]<='9')) { macros[n].nnamedargs=0; return; } } } char *strnl0(const char *s) /* replace "\\n" by "\n" in a cmd-line arg */ { char *t,*u; t=malloc(strlen(s)+1); u=t; while (*s!=0) { if ((*s=='\\')&&(s[1]=='n')) { *u='\n'; s++; } else *u=*s; s++; u++; } *u=0; return t; } char *strnl(const char *s) /* the same but with whitespace specifier handling */ { char *t,*u; int neg; t=malloc(strlen(s)+1); u=t; if (!isdelim(*s)) bug("character not allowed to start a syntax specifier"); while (*s!=0) { if (((*s&0x60)==0)&&(*s!='\n')&&(*s!='\t')) bug("character not allowed in syntax specifier"); if (*s=='\\') { neg=(s[1]=='!'); switch(s[neg+1]) { case 'n': case 'r': *u='\n'; break; case 't': *u='\t'; break; case 'b': *u='\001'; break; /* one or more spaces */ case 'w': if (neg) bug("\\w and \\W cannot be negated"); *u='\002'; break; /* zero or more spaces */ case 'B': *u='\003'; break; /* one or more spaces or \n */ case 'W': if (neg) bug("\\w and \\W cannot be negated"); *u='\004'; break; /* zero or more spaces or \n */ case 'a': *u='\005'; break; /* alphabetic */ case 'A': *u='\006'; break; /* alphabetic + space */ case '#': *u='\007'; break; /* numeric */ case 'i': *u='\010'; break; /* identifier */ case 'o': *u='\013'; break; /* operator */ case 'O': *u='\014'; break; /* operator/parenthese */ default: *u='\\'; neg=-1; } if (neg>0) *u+=(char)128; s+=neg+1; } else if (*s==' ') *u='\001'; else *u=*s; s++; u++; } *u=0; return t; } /* same as strnl() but for C strings & in-place */ char *strnl2(char *s,int check_delim) { char *u; int neg; u=s; if (check_delim&&!isdelim(*s)) bug("character not allowed to start a syntax specifier"); while (*s!='"') { if (((*s&0x60)==0)&&(*s!='\n')&&(*s!='\t')) bug("character not allowed in syntax specifier"); if (*s=='\\') { neg=(s[1]=='!'); switch(s[neg+1]) { case 'n': case 'r': *u='\n'; break; case 't': *u='\t'; break; case 'b': *u='\001'; break; /* one or more spaces */ case 'w': if (neg) bug("\\w and \\W cannot be negated"); *u='\002'; break; /* zero or more spaces */ case 'B': *u='\003'; break; /* one or more spaces or \n */ case 'W': if (neg) bug("\\w and \\W cannot be negated"); *u='\004'; break; /* zero or more spaces or \n */ case 'a': *u='\005'; break; /* alphabetic */ case 'A': *u='\006'; break; /* alphabetic + space */ case '#': *u='\007'; break; /* numeric */ case 'i': *u='\010'; break; /* identifier */ case 'o': *u='\013'; break; /* operator */ case 'O': *u='\014'; break; /* operator/parenthese */ case '"': case '\\': if (!neg) { *u=s[1]; break; } default: bug("unknown escape sequence in syntax specifier"); } if (neg>0) *u+=(char)128; s+=neg+1; } else if (*s==' ') *u='\001'; else *u=*s; if (*s==0) bug("unterminated string in #mode command"); s++; u++; } *u=0; return (s+1); } int iswhitesep(const char *s) { while (iswhite(*s)||(*s=='\001')||(*s=='\002')||(*s=='\003')||(*s=='\004')) s++; return (*s==0); } int nowhite_strcmp(char *s,char *t) { char *p; while (iswhite(*s)) s++; while (iswhite(*t)) t++; if ((*s==0)||(*t==0)) return strcmp(s,t); p=s+strlen(s)-1; while (iswhite(*p)) *(p--)=0; p=t+strlen(t)-1; while (iswhite(*p)) *(p--)=0; return strcmp(s,t); } void parseCmdlineDefine(const char *s) { int l, i, argc; for (l=0;s[l]&&(s[l]!='=')&&(s[l]!='(');l++); i = findIdent(s,l); if (i>=0) delete_macro(i); newmacro(s,l,0); /* possibly allow named arguments: -Dmacro(arg1,arg2)=... (no spaces) */ if (s[l]=='(') { argc = 0; do { l++; i=l; while (!isdelim(s[i])) i++; if (s[i]!=',' && s[i]!=')') bug("invalid syntax in -D declaration"); if (i>l) argc++; macros[nmacros].argnames = realloc(macros[nmacros].argnames, (argc+1)*sizeof(char *)); if (i>l) { macros[nmacros].argnames[argc-1]=malloc(i-l+1); memcpy(macros[nmacros].argnames[argc-1], s+l, i-l); macros[nmacros].argnames[argc-1][i-l]=0; } l = i; } while (s[l]!=')'); l++; macros[nmacros].nnamedargs = argc; macros[nmacros].argnames[argc] = NULL; } /* the macro definition afterwards ! */ if (s[l]=='=') l++; else if (s[l]!=0) bug("invalid syntax in -D declaration"); macros[nmacros].macrolen=strlen(s+l); macros[nmacros++].macrotext=my_strdup(s+l); } int readModeDescription(char **args,struct MODE *mode,int ismeta) { if (!(*(++args))) return 0; mode->mStart=strnl(*args); if (!(*(++args))) return 0; mode->mEnd=strnl(*args); if (!(*(++args))) return 0; mode->mArgS=strnl(*args); if (!(*(++args))) return 0; mode->mArgSep=strnl(*args); if (!(*(++args))) return 0; mode->mArgE=strnl(*args); if (!(*(++args))) return 0; mode->stackchar=strnl(*args); if (!(*(++args))) return 0; mode->unstackchar=strnl(*args); if (ismeta) return 1; if (!(*(++args))) return 0; mode->mArgRef=strnl(*args); if (!(*(++args))) return 0; mode->quotechar=**args; return 1; } int parse_comment_specif(char c) { switch (c) { case 'I': case 'i': return FLAG_IGNORE; case 'c': return FLAG_COMMENT; case 's': return FLAG_STRING; case 'q': return OUTPUT_TEXT; case 'S': return FLAG_STRING|PARSE_MACROS; case 'Q': return OUTPUT_TEXT|PARSE_MACROS; case 'C': return FLAG_COMMENT|PARSE_MACROS; default: bug("Invalid comment/string modifier"); return 0; } } void add_comment(struct SPECS *S,const char *specif,char *start,char *end,char quote,char warn) { struct COMMENT *p; if (*start==0) bug("Comment/string start delimiter must be non-empty"); for (p=S->comments;p!=NULL;p=p->next) if (!strcmp(p->start,start)) { if (strcmp(p->end,end)) /* already exists with a different end */ bug("Conflicting comment/string delimiter specifications"); free(p->start); free(p->end); break; } if (p==NULL) { p=malloc(sizeof *p); p->next=S->comments; S->comments=p; } p->start=start; p->end=end; p->quote=quote; p->warn=warn; if (strlen(specif)!=3) bug("Invalid comment/string modifier"); p->flags[FLAG_META]=parse_comment_specif(specif[0]); p->flags[FLAG_USER]=parse_comment_specif(specif[1]); p->flags[FLAG_TEXT]=parse_comment_specif(specif[2]); } void delete_comment(struct SPECS *S,char *start) { struct COMMENT *p,*q; q=NULL; for (p=S->comments;p!=NULL;p=p->next) { if (!strcmp(p->start,start)) { if (q==NULL) S->comments=p->next; else q->next=p->next; free(p->start); free(p->end); free(p); free(start); return; } else q=p; } free(start); } void outchar(char c) { if (C->out->bufsize) { if (C->out->len+1==C->out->bufsize) { C->out->bufsize=C->out->bufsize*2; C->out->buf=realloc(C->out->buf,C->out->bufsize); if (C->out->buf==NULL) bug("Out of memory"); } C->out->buf[C->out->len++]=c; } else { if (dosmode&&(c==10)) { fputc(13,C->out->f); if (file_and_stdout) fputc(13,stdout); } if (c!=13) { fputc(c,C->out->f); if (file_and_stdout) fputc(c,stdout); } } } void sendout(const char *s,int l,int proc) /* only process the quotechar, that's all */ { int i; if (!commented[iflevel]) for (i=0;iUser.quotechar)) { i++; if (i==l) return; } if (s[i]!=0) outchar(s[i]); } else replace_definition_with_blank_lines(s, s+l-1, 0); } void extendBuf(int pos) { char *p; if (C->bufsize<=pos) { C->bufsize+=pos; /* approx double */ p=malloc(C->bufsize); memcpy(p,C->buf,C->len); free(C->malloced_buf); C->malloced_buf=C->buf=p; if (C->buf==NULL) bug("Out of memory"); } } char getChar(int pos) { static int lastchar = -666; int c; if (lastchar == -666 && !strcmp(S->Meta.mEnd, "\n")) lastchar='\n'; if (C->in==NULL) { if (pos>=C->len) return 0; else return C->buf[pos]; } extendBuf(pos); while (pos>=C->len) { do { c=fgetc(C->in); } while (c==13); if (lastchar=='\n') C->lineno++; lastchar=c; if (c==EOF) c=0; C->buf[C->len++]=(char)c; } return C->buf[pos]; } int whiteout(int *pos1,int *pos2) /* remove whitespace on both sides */ { while ((*pos1<*pos2)&&iswhite(getChar(*pos1))) (*pos1)++; while ((*pos1<*pos2)&&iswhite(getChar(*pos2-1))) (*pos2)--; return (*pos1<*pos2); } int identifierEnd(int start) { char c; c=getChar(start); if (c==0) return start; if (c==S->User.quotechar) { c=getChar(start+1); if (c==0) return (start+1); if (isdelim(c)) return (start+2); start+=2; c=getChar(start); } while (!isdelim(c)) c=getChar(++start); return start; } int iterIdentifierEnd(int start) { int x; while(1) { x=identifierEnd(start); if (x==start) return x; start=x; } } int IsInCharset(CHARSET_SUBSET x,int c) { return (x[c>>LOG_LONG_BITS] & 1L<<(c&((1<='a')&&(c<='z')) || ((c>='A')&&(c<='Z')) ||(c==' ')||(c=='\t')||(c=='\n'); break; case '\005': c=getChar(i++); match = ((c>='a')&&(c<='z')) || ((c>='A')&&(c<='Z')); break; case '\007': c=getChar(i++); match = ((c>='0')&&(c<='9')); break; case '\010': c=getChar(i++); match = IsInCharset(S->id_set,c); break; case '\011': c=getChar(i++); match = (c=='\t'); break; case '\012': c=getChar(i++); match = (c=='\n'); break; case '\013': c=getChar(i++); match = IsInCharset(S->op_set,c); break; case '\014': c=getChar(i++); match = IsInCharset(S->ext_op_set,c) || IsInCharset(S->op_set,c); break; } if ((*s)&0x80) match=!match; if (!match) return 0; } else if (getChar(i++)!=*s) return 0; s++; } *pos=i; return 1; } int matchEndSequence(const char *s,int *pos) { if (*s==0) return 1; /* if terminator is \n and we're at end of input, let it be... */ if (getChar(*pos)==0 && s[0]=='\n' && s[1]==0) return 1; if (!matchSequence(s,pos)) return 0; if (S->preservelf&&iswhite(getChar(*pos-1))) (*pos)--; return 1; } int matchStartSequence(const char *s,int *pos) { char c; int match; if (!((*s)&0x60)) { /* special sequences from prev. context */ c=getChar(*pos-1); match=1; if (*s==0) return 1; switch((*s)&0x1f) { case '\001': if ((c!=' ')&&(c!='\t')) { match=0; break; } case '\002': break; case '\003': if ((c!=' ')&&(c!='\t')&&(c!='\n')) { match=0; break; } case '\004': break; case '\006': if ((c==' ')||(c=='\t')||(c=='\n')) break; case '\005': match = ((c>='a')&&(c<='z')) || ((c>='A')&&(c<='Z')); break; case '\007': match = ((c>='0')&&(c<='9')); break; case '\010': match = IsInCharset(S->id_set,c); break; case '\011': match = (c=='\t'); break; case '\012': match = (c=='\n'); break; case '\013': match = IsInCharset(S->op_set,c); break; case '\014': match = IsInCharset(S->ext_op_set,c) || IsInCharset(S->op_set,c); break; } if ((*s)&0x80) match=!match; if (!match) return 0; s++; } return matchSequence(s,pos); } void AddToCharset(CHARSET_SUBSET x,int c) { x[c>>LOG_LONG_BITS] |= 1L<<(c&((1<=*s)) { for (c=*s;c<=s[2];c++) AddToCharset(x,c); s+=2; } else AddToCharset(x,*s); s++; } return x; } int idequal(const char *b,int l,const char *s) { int i; if ((int)strlen(s)!=l) return 0; for (i=0;inamedargs[i]; if (s==NULL) return -1; if (idequal(b,l,s)) return i; } } void shiftIn(int l) { int i; if (l<=1) return; l--; if (l>=C->len) C->len=0; else { if (C->len-l>100) { /* we want to shrink that buffer */ C->buf+=l; C->bufsize-=l; } else for (i=l;ilen;i++) C->buf[i-l]=C->buf[i]; C->len-=l; C->eof=(C->buf[0]==0); } if (C->len<=1) { if (C->in==NULL) C->eof=1; else C->eof=feof(C->in); } } void initthings(int argc, char **argv) { char **arg, *s; int i,isinput,isoutput,ishelp,ismode,hasmeta,usrmode; DefaultOp=MakeCharsetSubset(DEFAULT_OP_STRING); PrologOp=MakeCharsetSubset(PROLOG_OP_STRING); DefaultExtOp=MakeCharsetSubset(DEFAULT_OP_PLUS); DefaultId=MakeCharsetSubset(DEFAULT_ID_STRING); nmacros=0; nalloced=31; macros=malloc(nalloced*sizeof *macros); S=malloc(sizeof *S); S->User=CUser; S->Meta=CMeta; S->comments=NULL; S->stack_next=NULL; S->preservelf=0; S->op_set=DefaultOp; S->ext_op_set=DefaultExtOp; S->id_set=DefaultId; C=malloc(sizeof *C); C->in=stdin; C->argc=0; C->argv=NULL; C->filename=my_strdup("stdin"); C->out=malloc(sizeof *(C->out)); C->out->f=stdout; C->out->bufsize=0; C->lineno=1; isinput=isoutput=ismode=ishelp=hasmeta=usrmode=0; nincludedirs=0; C->bufsize=80; C->len=0; C->buf=C->malloced_buf=malloc(C->bufsize); C->eof=0; C->namedargs=NULL; C->in_comment=0; C->ambience=FLAG_TEXT; C->may_have_args=0; commented[0]=0; iflevel=0; execallowed=0; autoswitch=0; dosmode=DEFAULT_CRLF; for (arg=argv+1;*arg;arg++) { if (strcmp(*arg, "--help") == 0 || strcmp(*arg, "-h") == 0) { usage(); exit(EXIT_SUCCESS); } if (strcmp(*arg, "--version") == 0) { display_version(); exit(EXIT_SUCCESS); } #define DEPRECATED_WARNING fprintf(stderr, "gpp: warning: deprecated option `%s'; use `-%s' instead\n", *arg, *arg) if (strcmp(*arg, "-nostdinc") == 0) { DEPRECATED_WARNING; NoStdInc = 1; continue; } if (strcmp(*arg, "-nocurinc") == 0) { DEPRECATED_WARNING; NoCurIncFirst = 1; continue; } if (strcmp(*arg, "-curdirinclast") == 0) { DEPRECATED_WARNING; CurDirIncLast = 1; NoCurIncFirst = 1; continue; } if (strcmp(*arg, "-includemarker") == 0) { DEPRECATED_WARNING; if (!(*(++arg))) { usage(); exit(EXIT_FAILURE); } construct_include_directive_marker(&include_directive_marker, *arg); continue; } if (strcmp(*arg, "--include") == 0) { if (!(*(++arg))) { usage(); exit(EXIT_FAILURE); } IncludeFile = *arg; continue; } if (strcmp(*arg, "-warninglevel") == 0) { DEPRECATED_WARNING; if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} WarningLevel = atoi(*arg); continue; } if (strcmp(*arg, "--nostdinc") == 0) { NoStdInc = 1; continue; } if (strcmp(*arg, "--nocurinc") == 0) { NoCurIncFirst = 1; continue; } if (strcmp(*arg, "--curdirinclast") == 0) { CurDirIncLast = 1; NoCurIncFirst = 1; continue; } if (strcmp(*arg, "--includemarker") == 0) { if (!(*(++arg))) { usage(); exit(EXIT_FAILURE); } construct_include_directive_marker(&include_directive_marker, *arg); continue; } if (strcmp(*arg, "--warninglevel") == 0) { if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} WarningLevel = atoi(*arg); continue; } if (**arg=='+') { switch((*arg)[1]) { case 'c': s=(*arg)+2; if (*s==0) s="ccc"; if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} add_comment(S,s,strnl(*(arg-1)),strnl(*arg),0,0); break; case 's': s=(*arg)+2; if (*s==0) s="sss"; if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} add_comment(S,s,strnl(*(arg-2)),strnl(*(arg-1)),**arg,0); break; case 'z': dosmode=0; break; case 'n': S->preservelf=0; break; default: ishelp=1; } } else if (**arg!='-') { ishelp|=isinput; isinput=1; C->in=fopen(*arg,"r"); free(C->filename); C->filename=my_strdup(*arg); if (C->in==NULL) bug("Cannot open input file"); } else switch((*arg)[1]) { case 'I': if (nincludedirs==MAXINCL) bug("too many include directories"); if ((*arg)[2]==0) { if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} includedir[nincludedirs++]=my_strdup(*arg); } else includedir[nincludedirs++]=my_strdup((*arg)+2); break; case 'C': ishelp|=ismode|hasmeta|usrmode; ismode=1; S->User=KUser; S->Meta=KMeta; S->preservelf=1; add_comment(S,"ccc",my_strdup("/*"),my_strdup("*/"),0,0); add_comment(S,"ccc",my_strdup("//"),my_strdup("\n"),0,0); add_comment(S,"ccc",my_strdup("\\\n"),my_strdup(""),0,0); add_comment(S,"sss",my_strdup("\""),my_strdup("\""),'\\','\n'); add_comment(S,"sss",my_strdup("'"),my_strdup("'"),'\\','\n'); break; case 'P': ishelp|=ismode|hasmeta|usrmode; ismode=1; S->User=KUser; S->Meta=KMeta; S->preservelf=1; S->op_set=PrologOp; add_comment(S,"css",my_strdup("\213/*"),my_strdup("*/"),0,0); /* \!o */ add_comment(S,"cii",my_strdup("\\\n"),my_strdup(""),0,0); add_comment(S,"css",my_strdup("%"),my_strdup("\n"),0,0); add_comment(S,"sss",my_strdup("\""),my_strdup("\""),0,'\n'); add_comment(S,"sss",my_strdup("\207'"),my_strdup("'"),0,'\n'); /* \!# */ break; case 'T': ishelp|=ismode|hasmeta|usrmode; ismode=1; S->User=S->Meta=Tex; break; case 'H': ishelp|=ismode|hasmeta|usrmode; ismode=1; S->User=S->Meta=Html; break; case 'X': ishelp|=ismode|hasmeta|usrmode; ismode=1; S->User=S->Meta=XHtml; break; case 'U': ishelp|=ismode|usrmode; usrmode=1; if (!readModeDescription(arg,&(S->User),0)) {usage(); exit(EXIT_FAILURE);} arg+=9; if (!hasmeta) S->Meta=S->User; break; case 'M': ishelp|=ismode|hasmeta; hasmeta=1; if (!readModeDescription(arg,&(S->Meta),1)) {usage(); exit(EXIT_FAILURE);} arg+=7; break; case 'O': file_and_stdout = 1; case 'o': if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} ishelp|=isoutput; isoutput=1; C->out->f=fopen(*arg,"w"); if (C->out->f==NULL) bug("Cannot create output file"); break; case 'D': if ((*arg)[2]==0) { if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} s=strnl0(*arg); } else s=strnl0((*arg)+2); parseCmdlineDefine(s); free(s); break; case 'x': execallowed=1; break; case 'n': S->preservelf=1; break; case 'z': dosmode=1; break; case 'c': case 's': if (!(*(++arg))) {usage(); exit(EXIT_FAILURE);} delete_comment(S,strnl(*arg)); break; case 'm': autoswitch=1; break; default: ishelp=1; } if (hasmeta&&!usrmode) {usage(); exit(EXIT_FAILURE);} if (ishelp) {usage(); exit(EXIT_FAILURE);} } #ifndef WIN_NT if ((nincludedirs==0) && !NoStdInc) { includedir[0]=my_strdup("/usr/include"); nincludedirs=1; } #endif for (i=0;i 1) warning("possible comment/string termination problem"); } if (c==quote) pos+=2; else if ((flags&PARSE_MACROS)&&(c==S->User.quotechar)) pos+=2; else pos++; } } void SkipPossibleComments(int *pos,int cmtmode,int silentonly) { int found; struct COMMENT *c; if (C->in_comment) return; do { found=0; if (getChar(*pos)==0) return; /* EOF */ for (c=S->comments;c!=NULL;c=c->next) if (!(c->flags[cmtmode]&FLAG_IGNORE)) if (!silentonly||(c->flags[cmtmode]==FLAG_COMMENT)) if (matchStartSequence(c->start,pos)) { *pos=findCommentEnd(c->end,c->quote,c->warn,*pos,c->flags[cmtmode]); matchEndSequence(c->end,pos); found=1; break; } } while (found); } /* look for a possible user macro. Input : idstart = scan start idcheck = check id for long macro forms before splicing args ? cmtmode = comment mode (FLAG_META or FLAG_USER) Output : idstart/idend = macro name location sh_end/lg_end = macro form end (-1 if no match) argb/arge = argument locations for long form argc = argument count for long form id = macro id, if idcheck was set at input */ int SplicePossibleUser(int *idstart,int *idend,int *sh_end,int *lg_end, int *argb,int *arge,int *argc,int idcheck, int *id,int cmtmode) { int match,k,pos; if (!matchStartSequence(S->User.mStart,idstart)) return 0; *idend=identifierEnd(*idstart); if ((*idend)&&!getChar(*idend-1)) return 0; /* look for args or no args */ *sh_end=*idend; if (!matchEndSequence(S->User.mEnd,sh_end)) *sh_end=-1; pos=*idend; match=matchSequence(S->User.mArgS,&pos); if (idcheck) { *id=findIdent(C->buf+*idstart,*idend-*idstart); if (*id<0) match=0; } *lg_end=-1; if (match) { *argc=0; while (1) { if (*argc>=MAXARGS) bug("too many macro parameters"); argb[*argc]=pos; k=0; while(1) { /* look for mArgE, mArgSep, or comment-start */ pos=iterIdentifierEnd(pos); SkipPossibleComments(&pos,cmtmode,0); if (getChar(pos)==0) return (*sh_end>=0); /* EOF */ if (strchr(S->User.stackchar,getChar(pos))) k++; if (k) { if (strchr(S->User.unstackchar,getChar(pos))) k--; } else { arge[*argc]=pos; if (matchSequence(S->User.mArgSep,&pos)) { match=0; break; } if (matchEndSequence(S->User.mArgE,&pos)) { match=1; break; } } pos++; /* nothing matched, go forward */ } (*argc)++; if (match) { /* no more args */ *lg_end=pos; break; } } } return ((*lg_end>=0)||(*sh_end>=0)); } int findMetaArgs(int start,int *p1b,int *p1e,int *p2b,int *p2e,int *endm,int *argc,int *argb,int *arge) { int pos,k; int hyp_end1,hyp_end2; /* look for mEnd or mArgS */ pos=start; if (!matchSequence(S->Meta.mArgS,&pos)) { if (!matchEndSequence(S->Meta.mEnd,&pos)) return -1; *endm=pos; return 0; } *p1b=pos; /* special syntax for #define : 1st arg is a macro call */ if ((*argc)&&SplicePossibleUser(&pos,p1e,&hyp_end1,&hyp_end2, argb,arge,argc,0,NULL,FLAG_META)) { *p1b=pos; if (hyp_end2>=0) pos=hyp_end2; else { pos=hyp_end1; *argc=0; } if (!matchSequence(S->Meta.mArgSep,&pos)) { if (!matchEndSequence(S->Meta.mArgE,&pos)) bug("#define/#defeval requires an identifier or a single macro call"); *endm=pos; return 1; } } else { *argc=0; k=0; while(1) { /* look for mArgE, mArgSep, or comment-start */ pos=iterIdentifierEnd(pos); SkipPossibleComments(&pos,FLAG_META,0); if (getChar(pos)!=0 && strchr(S->Meta.stackchar,getChar(pos))) k++; if (k) { if (getChar(pos)!=0 && strchr(S->Meta.unstackchar,getChar(pos))) k--; } else { *p1e=pos; if (matchSequence(S->Meta.mArgSep,&pos)) break; if (matchEndSequence(S->Meta.mArgE,&pos)) { *endm=pos; return 1; } } if (getChar(pos)==0) bug("unfinished macro argument"); pos++; /* nothing matched, go forward */ } } *p2b=pos; k=0; while(1) { /* look for mArgE or comment-start */ pos=iterIdentifierEnd(pos); SkipPossibleComments(&pos,FLAG_META,0); if (getChar(pos)!=0 && strchr(S->Meta.stackchar,getChar(pos))) k++; if (k) { if (getChar(pos)!=0 && strchr(S->Meta.unstackchar,getChar(pos))) k--; } else { *p2e=pos; if (matchEndSequence(S->Meta.mArgE,&pos)) break; } if (getChar(pos)==0) bug("unfinished macro"); pos++; /* nothing matched, go forward */ } *endm=pos; return 2; } char *ProcessText(const char *buf,int l,int ambience) { char *s; struct INPUTCONTEXT *T; if (l==0) { s=malloc(1); s[0]=0; return s; } s=malloc(l+2); s[0]='\n'; memcpy(s+1,buf,l); s[l+1]=0; T=C; C=malloc(sizeof *C); C->out=malloc(sizeof *(C->out)); C->in=NULL; C->argc=T->argc; C->argv=T->argv; C->filename=T->filename; C->out->buf=malloc(80); C->out->len=0; C->out->bufsize=80; C->out->f=NULL; C->lineno=T->lineno; C->bufsize=l+2; C->len=l+1; C->buf=C->malloced_buf=s; C->eof=0; C->namedargs=T->namedargs; C->in_comment=T->in_comment; C->ambience=ambience; C->may_have_args=T->may_have_args; ProcessContext(); outchar(0); /* note that outchar works with the half-destroyed context ! */ s=C->out->buf; free(C->out); free(C); C=T; return s; } int SpliceInfix(const char *buf,int pos1,int pos2,char *sep,int *spl1,int *spl2) { int pos,numpar,l; const char *p; numpar=0; l=strlen(sep); for (pos=pos2-1,p=buf+pos;pos>=pos1;pos--,p--) { if (*p==')') numpar++; if (*p=='(') numpar--; if (numpar<0) return 0; if ((numpar==0)&&(pos2-pos>=l)&&!strncmp(p,sep,l)) { *spl1=pos; *spl2=pos+l; return 1; } } return 0; } int DoArithmEval(char *buf,int pos1,int pos2,int *result) { int spl1,spl2,result1,result2,l; char c,*p; while ((pos1spl2)&&iswhite(buf[spl2])) spl2++; str1=strdup(buf+pos1); str1[spl1-pos1]='\0'; str2=strdup(buf+spl2); str2[pos2-spl2]='\0'; *result=(fnmatch(str2,str1,0)==0); free(str1); free(str2); } else *result=(result1==result2); return 1; } if (SpliceInfix(buf,pos1,pos2,">=",&spl1,&spl2)) { if (!DoArithmEval(buf,pos1,spl1,&result1)|| !DoArithmEval(buf,spl2,pos2,&result2)) { /* revert to string comparison */ while ((pos1spl2)&&iswhite(buf[spl2])) spl2++; l=spl1-pos1; if (l>pos2-spl2) l=pos2-spl2; result1=strncmp(buf+pos1,buf+spl2,l); *result=(result1>0) || ((result1==0) && (spl1-pos1>=pos2-spl2)); } else *result=(result1>=result2); return 1; } if (SpliceInfix(buf,pos1,pos2,">",&spl1,&spl2)) { if (!DoArithmEval(buf,pos1,spl1,&result1)|| !DoArithmEval(buf,spl2,pos2,&result2)) { /* revert to string comparison */ while ((pos1spl2)&&iswhite(buf[spl2])) spl2++; l=spl1-pos1; if (l>pos2-spl2) l=pos2-spl2; result1=strncmp(buf+pos1,buf+spl2,l); *result=(result1>0) || ((result1==0) && (spl1-pos1>pos2-spl2)); } else *result=(result1>result2); return 1; } if (SpliceInfix(buf,pos1,pos2,"<=",&spl1,&spl2)) { if (!DoArithmEval(buf,pos1,spl1,&result1)|| !DoArithmEval(buf,spl2,pos2,&result2)) { /* revert to string comparison */ while ((pos1spl2)&&iswhite(buf[spl2])) spl2++; l=spl1-pos1; if (l>pos2-spl2) l=pos2-spl2; result1=strncmp(buf+pos1,buf+spl2,l); *result=(result1<0) || ((result1==0) && (spl1-pos1<=pos2-spl2)); } else *result=(result1<=result2); return 1; } if (SpliceInfix(buf,pos1,pos2,"<",&spl1,&spl2)) { if (!DoArithmEval(buf,pos1,spl1,&result1)|| !DoArithmEval(buf,spl2,pos2,&result2)) { /* revert to string comparison */ while ((pos1spl2)&&iswhite(buf[spl2])) spl2++; l=spl1-pos1; if (l>pos2-spl2) l=pos2-spl2; result1=strncmp(buf+pos1,buf+spl2,l); *result=(result1<0) || ((result1==0) && (spl1-pos1=0) warning("the defined(...) macro is already defined"); else { newmacro("defined",strlen("defined"),1); macros[nmacros].macrolen=0; macros[nmacros].macrotext=malloc(1); macros[nmacros].macrotext[0]=0; macros[nmacros].nnamedargs=-2; /* trademark of the defined(...) macro */ nmacros++; } /* process the text in a usual way */ s=ProcessText(C->buf+pos1,pos2-pos1,FLAG_META); /* undefine the defined(...) operator */ if (i<0) { i=findIdent("defined",strlen("defined")); if ((i<0)||(macros[i].nnamedargs!=-2)) warning("the defined(...) macro was redefined in expression"); else delete_macro(i); } if (!DoArithmEval(s,0,strlen(s),&i)) return s; /* couldn't compute */ t=malloc(MAX_GPP_NUM_SIZE); sprintf(t,"%d",i); free(s); return t; } int comment_or_white(int start,int end,int cmtmode) { char c; while (startUser.quotechar)&&(startop_set=DefaultOp; P->ext_op_set=DefaultExtOp; P->id_set=DefaultId; FreeComments(P); if (!strcmp(opt,"C")||!strcmp(opt,"cpp")) { P->User=KUser; P->Meta=KMeta; P->preservelf=1; add_comment(P,"ccc",my_strdup("/*"),my_strdup("*/"),0,0); add_comment(P,"ccc",my_strdup("//"),my_strdup("\n"),0,0); add_comment(P,"ccc",my_strdup("\\\n"),my_strdup(""),0,0); add_comment(P,"sss",my_strdup("\""),my_strdup("\""),'\\','\n'); add_comment(P,"sss",my_strdup("'"),my_strdup("'"),'\\','\n'); } else if (!strcmp(opt,"TeX")||!strcmp(opt,"tex")) { P->User=Tex; P->Meta=Tex; P->preservelf=0; } else if (!strcmp(opt,"HTML")||!strcmp(opt,"html")) { P->User=Html; P->Meta=Html; P->preservelf=0; } else if (!strcmp(opt,"XHTML")||!strcmp(opt,"xhtml")) { P->User=XHtml; P->Meta=XHtml; P->preservelf=0; } else if (!strcmp(opt,"default")) { P->User=CUser; P->Meta=CMeta; P->preservelf=0; } else if (!strcmp(opt,"Prolog")||!strcmp(opt,"prolog")) { P->User=KUser; P->Meta=KMeta; P->preservelf=1; P->op_set=PrologOp; add_comment(P,"css",my_strdup("\213/*"),my_strdup("*/"),0,0); /* \!o */ add_comment(P,"cii",my_strdup("\\\n"),my_strdup(""),0,0); add_comment(P,"css",my_strdup("%"),my_strdup("\n"),0,0); add_comment(P,"sss",my_strdup("\""),my_strdup("\""),0,'\n'); add_comment(P,"sss",my_strdup("\207'"),my_strdup("'"),0,'\n'); /* \!# */ } else bug("unknown standard mode"); } void ProcessModeCommand(int p1start,int p1end,int p2start,int p2end) { struct SPECS *P; char *s,*p,*opt; int nargs,check_isdelim; char *args[10]; /* can't have more than 10 arguments */ whiteout(&p1start,&p1end); if ((p1start==p1end)||(identifierEnd(p1start)!=p1end)) bug("invalid #mode syntax"); if (p2start<0) s=my_strdup(""); else s=ProcessText(C->buf+p2start,p2end-p2start,FLAG_META); /* argument parsing */ p=s; opt=NULL; while (iswhite(*p)) p++; if ((*p!='"')&&(*p!=0)) { opt=p; while ((*p!=0)&&!iswhite(*p)) p++; if (*p!=0) { *(p++)=0; while (iswhite(*p)) p++; } } nargs=0; check_isdelim=!idequal(C->buf+p1start,p1end-p1start,"charset"); while (*p!=0) { if (nargs==10) bug("too many arguments in #mode command"); if (*(p++)!='"') bug("syntax error in #mode command (missing \" or trailing data)"); args[nargs++]=p; p=strnl2(p,check_isdelim); while (iswhite(*p)) p++; } if (idequal(C->buf+p1start,p1end-p1start,"quote")) { if (opt||(nargs>1)) bug("syntax error in #mode quote command"); if (nargs==0) args[0]=""; S->stack_next->User.quotechar=args[0][0]; } else if (idequal(C->buf+p1start,p1end-p1start,"comment")) { if ((nargs<2)||(nargs>4)) bug("syntax error in #mode comment command"); if (!opt) opt="ccc"; if (nargs<3) args[2]=""; if (nargs<4) args[3]=""; add_comment(S->stack_next,opt,my_strdup(args[0]),my_strdup(args[1]),args[2][0],args[3][0]); } else if (idequal(C->buf+p1start,p1end-p1start,"string")) { if ((nargs<2)||(nargs>4)) bug("syntax error in #mode string command"); if (!opt) opt="sss"; if (nargs<3) args[2]=""; if (nargs<4) args[3]=""; add_comment(S->stack_next,opt,my_strdup(args[0]),my_strdup(args[1]),args[2][0],args[3][0]); } else if (idequal(C->buf+p1start,p1end-p1start,"save") ||idequal(C->buf+p1start,p1end-p1start,"push")) { if ((opt!=NULL)||nargs) bug("too many arguments to #mode save"); P=CloneSpecs(S->stack_next); P->stack_next=S->stack_next; S->stack_next=P; } else if (idequal(C->buf+p1start,p1end-p1start,"restore") ||idequal(C->buf+p1start,p1end-p1start,"pop")) { if ((opt!=NULL)||nargs) bug("too many arguments to #mode restore"); P=S->stack_next->stack_next; if (P==NULL) bug("#mode restore without #mode save"); FreeComments(S->stack_next); free(S->stack_next); S->stack_next=P; } else if (idequal(C->buf+p1start,p1end-p1start,"standard")) { if ((opt==NULL)||nargs) bug("syntax error in #mode standard"); SetStandardMode(S->stack_next,opt); } else if (idequal(C->buf+p1start,p1end-p1start,"user")) { if ((opt!=NULL)||(nargs!=9)) bug("#mode user requires 9 arguments"); S->stack_next->User.mStart=my_strdup(args[0]); S->stack_next->User.mEnd=my_strdup(args[1]); S->stack_next->User.mArgS=my_strdup(args[2]); S->stack_next->User.mArgSep=my_strdup(args[3]); S->stack_next->User.mArgE=my_strdup(args[4]); S->stack_next->User.stackchar=my_strdup(args[5]); S->stack_next->User.unstackchar=my_strdup(args[6]); S->stack_next->User.mArgRef=my_strdup(args[7]); S->stack_next->User.quotechar=args[8][0]; } else if (idequal(C->buf+p1start,p1end-p1start,"meta")) { if ((opt!=NULL)&&!nargs&&!strcmp(opt,"user")) S->stack_next->Meta=S->stack_next->User; else { if ((opt!=NULL)||(nargs!=7)) bug("#mode meta requires 7 arguments"); S->stack_next->Meta.mStart=my_strdup(args[0]); S->stack_next->Meta.mEnd=my_strdup(args[1]); S->stack_next->Meta.mArgS=my_strdup(args[2]); S->stack_next->Meta.mArgSep=my_strdup(args[3]); S->stack_next->Meta.mArgE=my_strdup(args[4]); S->stack_next->Meta.stackchar=my_strdup(args[5]); S->stack_next->Meta.unstackchar=my_strdup(args[6]); } } else if (idequal(C->buf+p1start,p1end-p1start,"preservelf")) { if ((opt==NULL)||nargs) bug("syntax error in #mode preservelf"); if (!strcmp(opt,"1")||!my_strcasecmp(opt,"on")) S->stack_next->preservelf=1; else if (!strcmp(opt,"0")||!my_strcasecmp(opt,"off")) S->stack_next->preservelf=0; else bug("#mode preservelf requires on/off argument"); } else if (idequal(C->buf+p1start,p1end-p1start,"nocomment") ||idequal(C->buf+p1start,p1end-p1start,"nostring")) { if ((opt!=NULL)||(nargs>1)) bug("syntax error in #mode nocomment/nostring"); if (nargs==0) FreeComments(S->stack_next); else delete_comment(S->stack_next,my_strdup(args[0])); } else if (idequal(C->buf+p1start,p1end-p1start,"charset")) { if ((opt==NULL)||(nargs!=1)) bug("syntax error in #mode charset"); if (!my_strcasecmp(opt,"op")) S->stack_next->op_set=MakeCharsetSubset((unsigned char *)args[0]); else if (!my_strcasecmp(opt,"par")) S->stack_next->ext_op_set=MakeCharsetSubset((unsigned char *)args[0]); else if (!my_strcasecmp(opt,"id")) S->stack_next->id_set=MakeCharsetSubset((unsigned char *)args[0]); else bug("unknown charset subset name in #mode charset"); } else bug("unrecognized #mode command"); free(s); } static void DoInclude(char *file_name) { struct INPUTCONTEXT *N; char *incfile_name = NULL; FILE *f = NULL; int i, j; int len = strlen(file_name); /* if absolute path name is specified */ if (file_name[0]==SLASH #ifdef WIN_NT || (isalpha(file_name[0]) && file_name[1]==':') #endif ) f=fopen(file_name,"r"); else /* search current dir, if this search isn't turned off */ if (!NoCurIncFirst) { f = openInCurrentDir(file_name); } for (j=0;(f==NULL)&&(jin=f; C->argc=0; C->argv=NULL; C->filename=file_name; C->out=N->out; C->lineno=1; C->bufsize=80; C->len=0; C->buf=C->malloced_buf=malloc(C->bufsize); C->eof=0; C->namedargs=NULL; C->in_comment=0; C->ambience=FLAG_TEXT; C->may_have_args=0; PushSpecs(S); if (autoswitch) { if (!strcmp(file_name+strlen(file_name)-2,".h") || !strcmp(file_name+strlen(file_name)-2,".c")) SetStandardMode(S,"C"); } /* Include marker before the included contents */ write_include_marker(N->out->f, 1, C->filename, "1"); ProcessContext(); /* Include marker after the included contents */ write_include_marker(N->out->f, N->lineno, N->filename, "2"); /* Need to leave the blank line in lieu of #include, like cpp does */ replace_directive_with_blank_line(N->out->f); free(C); PopSpecs(); C=N; } int ParsePossibleMeta(void) { int cklen,nameend; int id,expparams,nparam,i,j; int p1start,p1end,p2start,p2end,macend; int argc,argb[MAXARGS],arge[MAXARGS]; char *tmpbuf; cklen=1; if (!matchStartSequence(S->Meta.mStart,&cklen)) return -1; nameend=identifierEnd(cklen); if (nameend&&!getChar(nameend-1)) return -1; id=0; argc=0; /* for #define with named args */ if (idequal(C->buf+cklen,nameend-cklen,"define")) /* check identifier */ { id=1; expparams=2; argc=1; } else if (idequal(C->buf+cklen,nameend-cklen,"undef")) { id=2; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"ifdef")) { id=3; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"ifndef")) { id=4; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"else")) { id=5; expparams=0; } else if (idequal(C->buf+cklen,nameend-cklen,"endif")) { id=6; expparams=0; } else if (idequal(C->buf+cklen,nameend-cklen,"include")) { id=7; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"exec")) { id=8; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"defeval")) { id=9; expparams=2; argc=1; } else if (idequal(C->buf+cklen,nameend-cklen,"ifeq")) { id=10; expparams=2; } else if (idequal(C->buf+cklen,nameend-cklen,"ifneq")) { id=11; expparams=2; } else if (idequal(C->buf+cklen,nameend-cklen,"eval")) { id=12; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"if")) { id=13; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"mode")) { id=14; expparams=2; } else if (idequal(C->buf+cklen,nameend-cklen,"line")) { id=15; expparams=0; } else if (idequal(C->buf+cklen,nameend-cklen,"file")) { id=16; expparams=0; } else if (idequal(C->buf+cklen,nameend-cklen,"elif")) { id=17; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"error")) { id=18; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"warning")) { id=19; expparams=1; } else if (idequal(C->buf+cklen,nameend-cklen,"date")) { id=20; expparams=1; } else return -1; /* #MODE magic : define "..." to be C-style strings */ if (id==14) { PushSpecs(S); S->preservelf=1; delete_comment(S,my_strdup("\"")); add_comment(S,"sss",my_strdup("\""),my_strdup("\""),'\\','\n'); } nparam=findMetaArgs(nameend,&p1start,&p1end,&p2start,&p2end,&macend,&argc,argb,arge); if (nparam==-1) return -1; if ((nparam==2)&&iswhitesep(S->Meta.mArgSep)) if (comment_or_white(p2start,p2end,FLAG_META)) nparam=1; if ((nparam==1)&&iswhitesep(S->Meta.mArgS)) if (comment_or_white(p1start,p1end,FLAG_META)) nparam=0; if (expparams&&!nparam) bug("Missing argument in meta-macro"); switch(id) { case 1: /* DEFINE */ if (!commented[iflevel]) { whiteout(&p1start,&p1end); /* recall comments are not allowed here */ if ((p1start==p1end)||(identifierEnd(p1start)!=p1end)) bug("#define requires an identifier (A-Z,a-z,0-9,_ only)"); /* buf starts 1 char before the macro */ i=findIdent(C->buf+p1start,p1end-p1start); if (i>=0) delete_macro(i); newmacro(C->buf+p1start,p1end-p1start,1); if (nparam==1) { p2end=p2start=p1end; } replace_definition_with_blank_lines(C->buf+1,C->buf+p2end,S->preservelf); macros[nmacros].macrotext=remove_comments(p2start,p2end,FLAG_META); macros[nmacros].macrolen=strlen(macros[nmacros].macrotext); macros[nmacros].defined_in_comment=C->in_comment; if (argc) { for (j=0;jbuf+argb[j],arge[j]-argb[j]); macros[nmacros].argnames[j][arge[j]-argb[j]]=0; } lookupArgRefs(nmacros++); } else replace_directive_with_blank_line(C->out->f); break; case 2: /* UNDEF */ replace_directive_with_blank_line(C->out->f); if (!commented[iflevel]) { if (nparam==2 && WarningLevel > 0) warning("Extra argument to #undef ignored"); whiteout(&p1start,&p1end); if ((p1start==p1end)||(identifierEnd(p1start)!=p1end)) bug("#undef requires an identifier (A-Z,a-z,0-9,_ only)"); i=findIdent(C->buf+p1start,p1end-p1start); if (i>=0) delete_macro(i); } break; case 3: /* IFDEF */ replace_directive_with_blank_line(C->out->f); iflevel++; if (iflevel==STACKDEPTH) bug("Too many nested #ifdefs"); commented[iflevel]=commented[iflevel-1]; if (!commented[iflevel]) { if (nparam==2 && WarningLevel > 0) warning("Extra argument to #ifdef ignored"); whiteout(&p1start,&p1end); if ((p1start==p1end)||(identifierEnd(p1start)!=p1end)) bug("#ifdef requires an identifier (A-Z,a-z,0-9,_ only)"); i=findIdent(C->buf+p1start,p1end-p1start); commented[iflevel]=(i==-1); } break; case 4: /* IFNDEF */ replace_directive_with_blank_line(C->out->f); iflevel++; if (iflevel==STACKDEPTH) bug("Too many nested #ifdefs"); commented[iflevel]=commented[iflevel-1]; if (!commented[iflevel]) { if (nparam==2 && WarningLevel > 0) warning("Extra argument to #ifndef ignored"); whiteout(&p1start,&p1end); if ((p1start==p1end)||(identifierEnd(p1start)!=p1end)) bug("#ifndef requires an identifier (A-Z,a-z,0-9,_ only)"); i=findIdent(C->buf+p1start,p1end-p1start); commented[iflevel]=(i!=-1); } break; case 5: /* ELSE */ replace_directive_with_blank_line(C->out->f); if (!commented[iflevel] && (nparam>0) && WarningLevel > 0) warning("Extra argument to #else ignored"); if (iflevel==0) bug("#else without #if"); if (!commented[iflevel-1] && commented[iflevel]!=2) commented[iflevel]=!commented[iflevel]; break; case 6: /* ENDIF */ replace_directive_with_blank_line(C->out->f); if (!commented[iflevel] && (nparam>0) && WarningLevel > 0) warning("Extra argument to #endif ignored"); if (iflevel==0) bug("#endif without #if"); iflevel--; break; case 7: /* INCLUDE */ if (!commented[iflevel]) { char *incfile_name; if (nparam==2 && WarningLevel > 0) warning("Extra argument to #include ignored"); if (!whiteout(&p1start,&p1end)) bug("Missing file name in #include"); /* user may put "" or <> */ if (((getChar(p1start)=='\"')&&(getChar(p1end-1)=='\"'))|| ((getChar(p1start)=='<')&&(getChar(p1end-1)=='>'))) { p1start++; p1end--; } if (p1start>=p1end) bug("Missing file name in #include"); incfile_name=malloc(p1end-p1start+1); /* extract the orig include filename */ for (i=0;iout->f); break; case 8: /* EXEC */ if (!commented[iflevel]) { if (!execallowed) warning("Not allowed to #exec. Command output will be left blank"); else { char *s,*t; int c; FILE *f; s=ProcessText(C->buf+p1start,p1end-p1start,FLAG_META); if (nparam==2) { t=ProcessText(C->buf+p2start,p2end-p2start,FLAG_META); i=strlen(s); s=realloc(s,i+strlen(t)+2); s[i]=' '; strcpy(s+i+1,t); free(t); } f=popen(s,"r"); free(s); if (f==NULL) warning("Cannot #exec. Command not found(?)"); else { while ((c=fgetc(f)) != EOF) outchar((char)c); pclose(f); } } } break; case 9: /* DEFEVAL */ if (!commented[iflevel]) { whiteout(&p1start,&p1end); if ((p1start==p1end)||(identifierEnd(p1start)!=p1end)) bug("#defeval requires an identifier (A-Z,a-z,0-9,_ only)"); tmpbuf=ProcessText(C->buf+p2start,p2end-p2start,FLAG_META); i=findIdent(C->buf+p1start,p1end-p1start); if (i>=0) delete_macro(i); newmacro(C->buf+p1start,p1end-p1start,1); if (nparam==1) { p2end=p2start=p1end; } replace_definition_with_blank_lines(C->buf+1,C->buf+p2end,S->preservelf); macros[nmacros].macrotext=tmpbuf; macros[nmacros].macrolen=strlen(macros[nmacros].macrotext); macros[nmacros].defined_in_comment=C->in_comment; if (argc) { for (j=0;jbuf+argb[j],arge[j]-argb[j]); macros[nmacros].argnames[j][arge[j]-argb[j]]=0; } lookupArgRefs(nmacros++); } else replace_directive_with_blank_line(C->out->f); break; case 10: /* IFEQ */ replace_directive_with_blank_line(C->out->f); iflevel++; if (iflevel==STACKDEPTH) bug("Too many nested #ifeqs"); commented[iflevel]=commented[iflevel-1]; if (!commented[iflevel]) { char *s,*t; if (nparam!=2) bug("#ifeq requires two arguments"); s=ProcessText(C->buf+p1start,p1end-p1start,FLAG_META); t=ProcessText(C->buf+p2start,p2end-p2start,FLAG_META); commented[iflevel]=(nowhite_strcmp(s,t)!=0); free(s); free(t); } break; case 11: /* IFNEQ */ replace_directive_with_blank_line(C->out->f); iflevel++; if (iflevel==STACKDEPTH) bug("Too many nested #ifeqs"); commented[iflevel]=commented[iflevel-1]; if (!commented[iflevel]) { char *s,*t; if (nparam!=2) bug("#ifneq requires two arguments"); s=ProcessText(C->buf+p1start,p1end-p1start,FLAG_META); t=ProcessText(C->buf+p2start,p2end-p2start,FLAG_META); commented[iflevel]=(nowhite_strcmp(s,t)==0); free(s); free(t); } break; case 12: /* EVAL */ if (!commented[iflevel]) { char *s,*t; if (nparam==2) p1end=p2end; /* we really want it all ! */ s=ArithmEval(p1start,p1end); for (t=s;*t;t++) outchar(*t); free(s); } break; case 13: /* IF */ replace_directive_with_blank_line(C->out->f); iflevel++; if (iflevel==STACKDEPTH) bug("Too many nested #ifs"); commented[iflevel]=commented[iflevel-1]; if (!commented[iflevel]) { char *s; if (nparam==2) p1end=p2end; /* we really want it all ! */ s=ArithmEval(p1start,p1end); commented[iflevel]=((s[0]=='0')&&(s[1]==0)); free(s); } break; case 14: /* MODE */ replace_directive_with_blank_line(C->out->f); if (nparam==1) p2start=-1; if (!commented[iflevel]) ProcessModeCommand(p1start,p1end,p2start,p2end); PopSpecs(); break; case 15: { /* LINE */ char buf[MAX_GPP_NUM_SIZE]; sprintf(buf, "%d", C->lineno); replace_directive_with_blank_line(C->out->f); sendout(buf, strlen(buf), 0); } break; case 16: /* FILE */ replace_directive_with_blank_line(C->out->f); sendout(C->filename, strlen(C->filename), 0); break; case 17: /* ELIF */ replace_directive_with_blank_line(C->out->f); if (iflevel==0) bug("#elif without #if"); if (!commented[iflevel-1]) { if (commented[iflevel]!=1) commented[iflevel]=2; else { char *s; commented[iflevel]=0; if (nparam==2) p1end=p2end; /* we really want it all ! */ s=ArithmEval(p1start,p1end); commented[iflevel]=((s[0]=='0')&&(s[1]==0)); free(s); } } break; case 18: /* ERROR */ replace_directive_with_blank_line(C->out->f); if (!commented[iflevel]) bug(ProcessText(C->buf + p1start, (nparam == 2 ? p2end : p1end) - p1start, FLAG_META)); break; case 19: /* WARNING */ replace_directive_with_blank_line(C->out->f); if (!commented[iflevel]) { char *s; s=ProcessText(C->buf + p1start, (nparam == 2 ? p2end : p1end) - p1start, FLAG_META); warning(s); free(s); } break; case 20: { /* DATE */ char buf[MAX_GPP_DATE_SIZE]; char *fmt; time_t now = time(NULL); fmt=ProcessText(C->buf + p1start, (nparam == 2 ? p2end : p1end) - p1start, FLAG_META); if (!strftime(buf, MAX_GPP_DATE_SIZE, fmt, localtime(&now))) bug("date buffer exceeded"); replace_directive_with_blank_line(C->out->f); sendout(buf, strlen(buf), 0); free(fmt); } break; default: bug("Internal meta-macro identification error"); } shiftIn(macend); return 0; } int ParsePossibleUser(void) { int idstart,idend,sh_end,lg_end,macend; int argc,id,i,l; char *argv[MAXARGS]; int argb[MAXARGS],arge[MAXARGS]; struct INPUTCONTEXT *T; idstart=1; id=0; if (!SplicePossibleUser(&idstart,&idend,&sh_end,&lg_end, argb,arge,&argc,1,&id,FLAG_USER)) return -1; if ((sh_end>=0)&&(C->namedargs!=NULL)) { i=findNamedArg(C->buf+idstart,idend-idstart); if (i>=0) { if (iargc) sendout(C->argv[i],strlen(C->argv[i]),0); shiftIn(sh_end); return 0; } } if (id<0) return -1; if (lg_end>=0) macend=lg_end; else { macend=sh_end; argc=0; } if (macros[id].nnamedargs==-2) { /* defined(...) macro for arithmetic */ char *s,*t; if (argc!=1) return -1; s=remove_comments(argb[0],arge[0],FLAG_USER); t=s+strlen(s)-1; if (*s!=0) while ((t!=s)&&iswhite(*t)) *(t--)=0; t=s; while (iswhite(*t)) t++; if (findIdent(t,strlen(t))>=0) outchar('1'); else outchar('0'); free(s); shiftIn(macend); return 0; } if (!macros[id].macrotext[0]) { /* the empty macro */ shiftIn(macend); return 0; } for (i=0;ibuf+argb[i],arge[i]-argb[i],FLAG_USER); /* process macro text */ T=C; C=malloc(sizeof *C); C->out=T->out; C->in=NULL; C->argc=argc; C->argv=argv; C->filename=T->filename; C->lineno=T->lineno; C->may_have_args=1; if ((macros[id].nnamedargs==-1)&&(lg_end>=0)&& (macros[id].define_specs->User.mEnd[0]==0)) { /* build an aliased macro call */ l=strlen(macros[id].macrotext)+2 +strlen(macros[id].define_specs->User.mArgS) +strlen(macros[id].define_specs->User.mArgE) +(argc-1)*strlen(macros[id].define_specs->User.mArgSep); for (i=0;ibuf=C->malloced_buf=malloc(l); l=strlen(macros[id].macrotext)+1; C->buf[0]='\n'; strcpy(C->buf+1,macros[id].macrotext); while ((l>1)&&iswhite(C->buf[l-1])) l--; strcpy(C->buf+l,macros[id].define_specs->User.mArgS); for (i=0;i0) strcat(C->buf,macros[id].define_specs->User.mArgSep); strcat(C->buf,argv[i]); } strcat(C->buf,macros[id].define_specs->User.mArgE); C->may_have_args=0; } else { C->buf=C->malloced_buf=malloc(strlen(macros[id].macrotext)+2); C->buf[0]='\n'; strcpy(C->buf+1,macros[id].macrotext); } C->len=strlen(C->buf); C->bufsize=C->len+1; C->eof=0; C->namedargs=macros[id].argnames; C->in_comment=macros[id].defined_in_comment; C->ambience=FLAG_META; PushSpecs(macros[id].define_specs); ProcessContext(); PopSpecs(); free(C); C=T; for (i=0;iin_comment) { cs=1; for (p=S->comments;p!=NULL;p=p->next) if (!(p->flags[C->ambience]&FLAG_IGNORE)) if (matchStartSequence(p->start,&cs)) { l=ce=findCommentEnd(p->end,p->quote,p->warn,cs,p->flags[C->ambience]); matchEndSequence(p->end,&l); if (p->flags[C->ambience]&OUTPUT_DELIM) sendout(C->buf+1,cs-1,0); if (!(p->flags[C->ambience]&OUTPUT_TEXT)) replace_definition_with_blank_lines(C->buf+1, C->buf+ce-1, 0); if (p->flags[C->ambience]&PARSE_MACROS) { C->in_comment=1; s=ProcessText(C->buf+cs,ce-cs,C->ambience); if (p->flags[C->ambience]&OUTPUT_TEXT) sendout(s,strlen(s),0); C->in_comment=0; free(s); } else if (p->flags[C->ambience]&OUTPUT_TEXT) sendout(C->buf+cs,ce-cs,0); if (p->flags[C->ambience]&OUTPUT_DELIM) sendout(C->buf+ce,l-ce,0); shiftIn(l); return; } } if (ParsePossibleMeta()>=0) return; if (ParsePossibleUser()>=0) return; l=1; /* If matching numbered macro argument and inside a macro */ if (matchSequence(S->User.mArgRef,&l) && C->may_have_args) { /* Process macro arguments referenced as #1,#2,... */ c=getChar(l); if ((c>='1')&&(c<='9')) { c=c-'1'; if (cargc) sendout(C->argv[(int)c],strlen(C->argv[(int)c]),0); shiftIn(l+1); return; } } l=identifierEnd(1); if (l==1) l=2; sendout(C->buf+1,l-1,1); shiftIn(l); } void ProcessContext(void) { if (C->len==0) { C->buf[0]='\n'; C->len++; } while (!C->eof) ParseText(); if (C->in!=NULL) fclose(C->in); free(C->malloced_buf); } /* additions by M. Kifer - revised D.A. 12/16/01 */ /* copy SLASH-terminated name of the directory of fname */ static void getDirname(const char *fname, char *dirname) { int i; for (i = strlen(fname)-1; i>=0; i--) { if (fname[i] == SLASH) break; } if (i >= 0) { strncpy(dirname,fname,i); dirname[i] = SLASH; } else /* just a precaution: i must be -1 in this case anyway */ i = -1; dirname[i+1] = '\0'; } static FILE *openInCurrentDir(const char *incfile) { char *absfile = calloc(strlen(C->filename)+strlen(incfile)+1, 1); FILE *f; getDirname(C->filename,absfile); strcat(absfile,incfile); f=fopen(absfile,"r"); free(absfile); return f; } /* skip = # of \n's already output by other mechanisms, to be skipped */ void replace_definition_with_blank_lines(const char *start, const char *end, int skip) { if ((include_directive_marker != NULL) && (C->out->f != NULL)) { while (start <= end) { if (*start == '\n') { if (skip) skip--; else fprintf(C->out->f,"\n"); } start++; } } } /* insert blank line where the metas IFDEF,ELSE,INCLUDE, etc., stood in the input text */ void replace_directive_with_blank_line(FILE *f) { if ((include_directive_marker != NULL) && (f != NULL) && (!S->preservelf) && (S->Meta.mArgE[0]=='\n')) { fprintf(f,"\n"); } } /* If lineno is > 15 digits - the number won't be printed correctly */ void write_include_marker(FILE *f, int lineno, char *filename, const char *marker) { static char lineno_buf[MAX_GPP_NUM_SIZE]; static char *escapedfilename = NULL; if ((include_directive_marker != NULL) && (f != NULL)) { #ifdef WIN_NT escape_backslashes(filename,&escapedfilename); #else escapedfilename = filename; #endif sprintf(lineno_buf,"%d", lineno); fprintf(f, include_directive_marker, lineno_buf, escapedfilename, marker); } } /* Under windows, files can have backslashes in them. These should be escaped. */ void escape_backslashes(const char *instr, char **outstr) { int out_idx=0; if (*outstr != NULL) free(*outstr); *outstr = malloc(2*strlen(instr)); while (*instr != '\0') { if (*instr=='\\') { *(*outstr+out_idx) = '\\'; out_idx++; } *(*outstr+out_idx) = *instr; out_idx++; instr++; } *(*outstr+out_idx) = '\0'; } /* includemarker_input should have 3 ?-marks, which are replaced with %s. Also, @ is replaced with a space. These symbols can be escaped with a backslash. */ void construct_include_directive_marker(char **include_directive_marker, const char *includemarker_input) { int len = strlen(includemarker_input); char ch; int in_idx=0, out_idx=0; int quoted = 0, num_repl = 0; /* only 6 extra chars are needed: 3 for the three %'s, 2 for \n, 1 for \0 */ *include_directive_marker = malloc(len+18); ch = *includemarker_input; while (ch != '\0' && in_idx < len) { if (quoted) { *(*include_directive_marker+out_idx) = ch; out_idx++; quoted = 0; } else { switch (ch) { case '\\': quoted = 1; break; case '@': *(*include_directive_marker+out_idx) = ' '; out_idx++; break; case '%': case '?': *(*include_directive_marker+out_idx) = '%'; out_idx++; *(*include_directive_marker+out_idx) = 's'; out_idx++; if (++num_repl > 3) bug("only 3 substitutions allowed in -includemarker"); break; default: *(*include_directive_marker+out_idx) = ch; out_idx++; } } in_idx++; ch = *(includemarker_input+in_idx); } *(*include_directive_marker+out_idx) = '\n'; out_idx++; *(*include_directive_marker+out_idx) = '\0'; } int main(int argc,char **argv) { initthings(argc,argv); /* The include marker at the top of the file */ if (IncludeFile) DoInclude(IncludeFile); write_include_marker(C->out->f, 1, C->filename, ""); ProcessContext(); fclose(C->out->f); return EXIT_SUCCESS; } gpp-2.24/src/Makefile.am0000644000076400001440000000101210074263630010526 # $Id: Makefile.am,v 1.3 2004/07/11 16:15:20 psy Exp $ # # Copyright (C) 2003 Tristan Miller # # This file is free software; the author gives unlimited permission to # copy and/or distribute it, with or without modifications. # # 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. bin_PROGRAMS = gpp gpp_SOURCES = gpp.c gpp-2.24/src/Makefile.in0000644000076400001440000003050410123366315010546 # Makefile.in generated by automake 1.9.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 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@ # $Id: Makefile.am,v 1.3 2004/07/11 16:15:20 psy Exp $ # # Copyright (C) 2003 Tristan Miller # # This file is free software; the author gives unlimited permission to # copy and/or distribute it, with or without modifications. # # 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. SOURCES = $(gpp_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = gpp$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_gpp_OBJECTS = gpp.$(OBJEXT) gpp_OBJECTS = $(am_gpp_OBJECTS) gpp_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(gpp_SOURCES) DIST_SOURCES = $(gpp_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ gpp_SOURCES = gpp.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: 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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 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 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) gpp$(EXEEXT): $(gpp_OBJECTS) $(gpp_DEPENDENCIES) @rm -f gpp$(EXEEXT) $(LINK) $(gpp_LDFLAGS) $(gpp_OBJECTS) $(gpp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpp.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-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: gpp-2.24/BUGS0000644000076400001440000000114310074264326006376 Bugs, limitations, and known issues for GPP. $Id: BUGS,v 1.3 2004/07/11 16:20:38 psy Exp $ (POTENTIAL) BUGS: * many function names are not ANSI/ISO-compliant (e.g., str...) * return values from malloc(), calloc(), realloc(), strdup() rarely checked * poor/misleading typography in LaTeX version of manual * spurious warning when comment on same line as #include directive AESTHETIC/STYLISTIC ISSUES WITH SOURCE CODE: * needs pretty-printing (more whitespace between arguments) * needs function prototypes * needs comments dividing code into sections * static keyword seems to be used indiscriminately gpp-2.24/NEWS0000644000076400001440000001144610123364704006415 GPP NEWS -- history of user-visible changes $Id: NEWS,v 1.8 2004/09/19 20:19:16 psy Exp $ See the end of this file for copying conditions. Please send GPP bug reports to Tristan Miller . Version 2.24 * Added a #date meta-macro allowing for formatting of dates and times Version 2.23 * Fixed a bug where #error and #warning directives were processed in the false branch of a conditional Version 2.22 * Added --include option which allows user to specify a file to be processed before the regular input file Version 2.21 * Added CPP-style #error and #warning meta-macros Version 2.20 * GPP's arithmetic evaluation macro (#eval) now supports file-globbing via =~ (POSIX only) * there is now an #elif macro to simplify conditional branching * fixed a bug where GPP would be off by one when reporting line numbers in its error messages or with the #line meta-macro Version 2.14 * fixed a crash bug * added built-in macros `line' and 'file' * GPP documentation is now under a free licence Version 2.13 * fixed bug which caused GPP to crash when the same macro was defined twice on the command line * GPP should compile on more systems now; non-standard C functions have been replaced with custom code * INSTALL contains installation instructions for Windows, Unix, and other systems. * GPP now issues a warning on use of deprecated command-line options * GPP is now packaged in a manner similar to most GNU programs, including a `configure' configuration/installation script suitable for Unix-like systems * credits moved from manual to AUTHORS and THANKS files * CHANGELOG superseded by files ChangeLog (detailed, for developers) and NEWS (brief, user-visible changes only) * added list of bugs and wishes as BUGS and TODO * minor changes (mostly typographical) to the manual Version 2.12 * New command-line options: - -X for XHTML mode - --help displays command-line option summary - --version displays version information - "long options" -nostdinc, -nocurinc, etc. changed to --nostdinc, --nocurinc, etc. * fixed miscellaneous typographical, grammatical, and spelling mistakes in documentation * licence changed from GNU Library GPL 2 to GNU Lesser GPL 2.1 * distribution now includes copy of the licence * new project maintainer: Tristan Miller Version 2.1 * Bugfixes: - bugfix in #defeval (can now be used to iteratively redefine a macro in terms of its previous definition) - bugfix in arithmetic evaluation (operator precedence between + and -, and between * and / was wrong) * Arithmetic evaluation: - length(...) builtin in #eval - all comparison operators revert to string comparison if arithmetic evaluation fails in #eval * Command-line options: - +n does the opposite of -n (do not preserve linefeeds; place *after* -C/-P) - -O sends output to file and stdout simultaneously - options to control directory search order for #include - option to adjust warning level - option to specify an include file marker to keep track of #include directives and line numbers in output * Misbehavior fixes: - numbered argument sequences (#1...#9) are disabled outside of definitions. - if a construct terminated by a newline is nested in last position within another construct, then the nested newline is optional. Concretely, this means that " #define myeval #eval #1 " is now valid. - macros defined on the command line with -D... can take named arguments. The syntax is: -Dmacro(arg1,...)=definition ; the definition should conform to the rules of the mode specified on the command-line, although the arguments are specified in C-style syntax (but without spaces !) - input line numbers are almost always preserved when -includemarker is specified * Miscellaneous: - LaTeX version of the manual in addition to man and html formats. ---------------------------------------------------------------------- Copyright information: Copyright (C) 2001 Denis Auroux. Copyright (C) 2003, 2004 Tristan Miller. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. gpp-2.24/TODO0000644000076400001440000000037210123364704006402 TODO file for GPP. $Id: TODO,v 1.7 2004/09/19 20:19:16 psy Exp $ This file lists potential improvements and wish-list items for GPP. * integrate code from the 2.1a ("fast") branch * add #cmd_line_args macro * internationalize with GNU gettext gpp-2.24/depcomp0000755000076400001440000003554510110111562007265 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2004-05-31.23 # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit 0 ;; -v | --v*) echo "depcomp $scriptversion" exit 0 ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # Dependencies are output in .lo.d with libtool 1.4. # With libtool 1.5 they are output both in $dir.libs/$base.o.d # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the # latter, because the former will be cleaned when $dir.libs is # erased. tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir$base.o.d" tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" else tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gpp-2.24/aclocal.m40000644000076400001440000011314310123366165007556 # generated automatically by aclocal 1.9.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # 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. # -*- Autoconf -*- # Copyright (C) 2002, 2003 Free Software Foundation, Inc. # Generated from amversion.in; do not edit by hand. # 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 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. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.1])]) # AM_AUX_DIR_EXPAND # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 6 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # serial 7 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 11 # 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.58])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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 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], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])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) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. 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)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # 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_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # -*- Autoconf -*- # Copyright (C) 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # 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 supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # Copyright (C) 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _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], [AC_FOREACH([_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. # # Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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 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)]) # AM_PROG_INSTALL_STRIP # Copyright (C) 2001, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # _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. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR gpp-2.24/README0000644000076400001440000000067410013426302006566 Welcome to GPP, a generic preprocessor. GPP is Free Software. Please see the file COPYING for details. The `doc' subdirectory contains a Unix man page and an HTML page describing how to use GPP. These files were generated by GPP from the file gpp.pp, which can also be preprocessed to produce a LaTeX version of the manual. Only the man page is installed by default. For building and installation instructions please see the INSTALL file. gpp-2.24/THANKS0000644000076400001440000000132210074264377006633 Many people have further contributed to GPP by reporting problems, suggesting various improvements, or submitting actual code. Here is a list of these people. Help me keep it complete and free of errors. Many thanks to Michael Kifer for valuable feedback and suggestions, and for contributing various patches included in version 2.1. Thanks to Albert Chin-A-Young for bug fixes and globbing for versions 2.14 and 2.20. Thanks to Stefan Heimann for suggesting new features incorporated into version 2.14. Thanks to Luis Recuerda Santiago for the --include patch incorporated into version 2.22. Thanks to Lucas Wall for providing a GPP package for Debian GNU/Linux. Thanks to Richard M. Myers for various bug reports. gpp-2.24/configure0000755000076400001440000046403310123366246007634 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for GPP 2.24. # # Report bugs to . # # Copyright (C) 2003 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 Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='GPP' PACKAGE_TARNAME='gpp' PACKAGE_VERSION='2.24' PACKAGE_STRING='GPP 2.24' PACKAGE_BUGREPORT='psychonaut@nothingisreal.com' ac_unique_file="src/gpp.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 GPP 2.24 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _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 GPP 2.24:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF GPP configure 2.24 generated by GNU Autoconf 2.59 Copyright (C) 2003 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GPP $as_me 2.24, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&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_sep= 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # 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 ( 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 rm -f conftest.file 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 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 $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } 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='gpp' VERSION='2.24' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # 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"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Checks for libraries. # Checks for header files. 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h string.h fnmatch.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to psychonaut@nothingisreal.com ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi # Checks for library functions. for ac_func in strcasecmp strchr strdup strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile src/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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by GPP $as_me 2.24, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GPP config.status 2.24 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; 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 if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 || { (exit 1); exit 1; } fi gpp-2.24/configure.ac0000644000076400001440000000134710123364704010203 # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # # $Id: configure.ac,v 1.12 2004/09/19 20:19:16 psy Exp $ AC_PREREQ(2.57) AC_INIT(GPP, 2.24, psychonaut@nothingisreal.com, gpp) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/gpp.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h fnmatch.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T # Checks for library functions. AC_CHECK_FUNCS([strcasecmp strchr strdup strtol]) AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT gpp-2.24/install-sh0000755000076400001440000002177410110111562007713 #!/bin/sh # install - install a program, script, or datafile scriptversion=2004-07-05.00 # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= 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: -c (ignored) -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. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; 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 for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog 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 "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $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 "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gpp-2.24/missing0000755000076400001440000002466610110111562007311 #! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2003-09-02.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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 run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: gpp-2.24/Makefile.am0000644000076400001440000000113710123366066007751 # $Id: Makefile.am,v 1.4 2004/07/11 16:15:18 psy Exp $ # # Copyright (C) 2003 Tristan Miller # # This file is free software; the author gives unlimited permission to # copy and/or distribute it, with or without modifications. # # 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. AUTOMAKE_OPTIONS = dist-bzip2 SUBDIRS = src man_MANS = doc/gpp.1 EXTRA_DIST = BUGS TODO doc/gpp.html doc/gpp.pp $(man_MANS) gpp-2.24/Makefile.in0000644000076400001440000004762110123366315007767 # Makefile.in generated by automake 1.9.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004 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@ # $Id: Makefile.am,v 1.4 2004/07/11 16:15:18 psy Exp $ # # Copyright (C) 2003 Tristan Miller # # This file is free software; the author gives unlimited permission to # copy and/or distribute it, with or without modifications. # # 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. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ THANKS TODO depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = dist-bzip2 SUBDIRS = src man_MANS = doc/gpp.1 EXTRA_DIST = BUGS TODO doc/gpp.html doc/gpp.pp $(man_MANS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: 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__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done # 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. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; 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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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 || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/doc @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__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*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(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 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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 $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-exec-am: install-info: install-info-recursive install-man: install-man1 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: uninstall-info-am uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-man1 install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am uninstall-man \ uninstall-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: gpp-2.24/config.h.in0000644000076400001440000000405210123366266007741 /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_FNMATCH_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned' if does not define. */ #undef size_t gpp-2.24/AUTHORS0000644000076400001440000000024507774354654007006 Authors of GPP. GPP was written by Denis Auroux . Since version 2.12 it has been maintained by Tristan Miller . gpp-2.24/INSTALL0000644000076400001440000002301110013430050006720 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2003, 2004 Tristan Miller. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== NON-UNIX SYSTEMS, INCLUDING MS-WINDOWS: You will need a C compiler. Copy the file config.in.h to src/config.h. Open the file and follow the instructions inside to modify it based on your system's capabilities. Then compile the gpp.c file in the `src' subdirectory with the macro HAVE_CONFIG_H #defined. On MS-Windows systems you may need to also #define the macro WIN_NT if your compiler does not already #define it by default. UNIX-LIKE SYSTEMS: These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. gpp-2.24/ChangeLog0000644000076400001440000001056210123364710007463 2004-09-19 Tristan Miller * NEWS, TODO, configure.ac, doc/gpp.pp, src/gpp.c: Added #date meta-macro 2004-07-11 Tristan Miller * configure.ac: Upgrade version number * THANKS: *** empty log message *** * NEWS: Downgraded version number * BUGS: Bug report from Richard M. Myers * TODO: More wishlist items from users * configure.ac, src/Makefile.am, src/gettext.h, src/gpp.c, autogen.mak, Makefile.am: Roll back changes to 2004-07-05 * Makefile.am, NEWS, THANKS, autogen.mak, configure.ac, src/Makefile.am, src/gettext.h, src/gpp.c: Added gettext patch from Lucas Wall 2004-07-05 Tristan Miller * src/gpp.c: Fixed bug where #error/#warning inside an #if block was always executed (even in the false branch) 2004-06-22 Tristan Miller * THANKS: Debian package 2004-02-14 Tristan Miller * NEWS, README, THANKS, TODO, configure.ac, doc/gpp.pp, src/gpp.c, BUGS, INSTALL: Added --include option 2004-02-07 Tristan Miller * TODO: Misc updates * INSTALL: Updated copyright notice. * INSTALL: Simplified installation instructions into Unix and non-Unix varieties. * doc/gpp.pp: Documentation for #error and #warning * NEWS: Changes for 2.21 * src/gpp.c: Added #error and #warning meta-macros * configure.ac: Bump version number 2004-01-17 Tristan Miller * NEWS: Describes new features in 2.20 * src/gpp.c: Adding globbing and elif support * doc/gpp.pp: Added documentation for globbing and elif * configure.ac: Now checks for fnmatch.h * THANKS: *** empty log message *** * src/gpp.c: Fixed line number bug * configure.ac: *** empty log message *** * configure.ac: Removed MALLOC/REALLOC checks (we never malloc(0) anyway AFAIK) 2004-01-16 Tristan Miller * THANKS, TODO, configure.ac, doc/gpp.pp, src/gpp.c, NEWS: Fixed crash bug, added #line and #file macros, updated licence for documentation * TODO: *** empty log message *** 2003-12-31 Tristan Miller * Makefile.am: Added BUGS, TODO to distribution * NEWS, README, THANKS, TODO, configure.ac, doc/gpp.pp, gpp.c, gpphelp.pp, src/Makefile.am, src/gpp.c, AUTHORS, BUGS, CHANGELOG, COPYING, INSTALL, LICENCE, Makefile, Makefile.am: Autoconfiscated plus various bugfixes and updates; see NEWS for details 2003-11-22 Tristan Miller * CHANGELOG, gpp.c: Changed licence * gpphelp.pp: *** empty log message *** * README: Initial import * Makefile, CHANGELOG: *** empty log message *** * CHANGELOG: Added CVS Id string * CHANGELOG: Licence * gpphelp.pp: Changed copyright notices * gpp.c: Added to to-do list * gpp.c: Changed copyright notices * Makefile: Added CVS Id string * CHANGELOG: *** empty log message *** * gpphelp.pp: Added documentation for long options * gpp.c: Added long option variants * gpphelp.pp: Documentation for -h, --help, --version * gpp.c: Added -help, -version arguments * CHANGELOG: *** empty log message *** * gpphelp.pp: Fixed grammar, spelling, typography, typos 2003-11-21 Tristan Miller * gpphelp.pp: Changed copyright notices * gpp.c: *** empty log message *** * gpp.c: Updated version number * gpp.c: *** empty log message *** * gpp.c: Added const qualifiers where appropriate (may not have caught them all, though) * gpp.c: Removed casting to calloc() calls, sizeof(char) * gpp.c: Removed casting to realloc() calls * gpp.c: Removed casting in memcpy() * gpp.c: Many instances of () -> (void) * gpp.c: ProcessContext() -> ProcessContext(void) * gpp.c: Removed malloc() casting 2003-10-04 Tristan Miller * LICENCE: LGPL * LICENCE: Wrong licence; should be LGPL * LICENCE: Adding GNU licence * gpphelp.pp: Added nothingisreal.com home page * gpp.c: Misc authorship changes and C code niceties * gpphelp.pp: Fixed bugs in author attribution * gpphelp.pp: Deleted space before /> in example * CHANGELOG, Makefile, gpp.1, gpp.c, gpp.html, gpphelp.pp: Initial release of 2.11 * CHANGELOG, Makefile, gpp.1, gpp.c, gpp.html, gpphelp.pp: Initial import into CVS * CHANGELOG, Makefile, gpp.1, gpp.c, gpp.html, gpphelp.pp: New file. gpp-2.24/COPYING0000644000076400001440000006347607737605773007010 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it!